日期:2014-05-20 浏览次数:20952 次
public class Member
{
public int Id { get; set; }
public string Fullname{ get; set; }
public string Nickname { get;set; }
public Detail Detail{ get;set;}
}
public class Detail
{
public int DetailId { get; set; }
public string Address{ get; set; }
public Member Member { get; set; }
}
Member entity = Context.Member.FirstOrDefault(p=>p.Id == id);
entity.Fullname = "菜鸟";
entity.Detail.Address = "xx";
Context.Member.ApplyCurrentValues(entity);
Context.SaveChanges()