在有实体框架的ASP NET MVC 3中,我有一个领域,有导航财产指另一个物体:
public class Person
{
public String Name {get;set;}
public Guid CompanyID{get;set;}
[ForeignKey(CompanyID)]
public virtual CompanyType Company{ get; set; }
}
When I create an instance of Person and try to add it to the database, the DBContext keeps a cache of this entity Person and sends it to the database. So later on in the lifetime of the same context instance, when I try to access this entity, the Company field is always null since the navigation property never got updated.
是否有办法更新数据库中有哪些内容?
La的负荷工作已经停止。