鉴于
public class Customer
{
public int Id { get; set; }
[Required]
[StringLength(255)]
public string Name { get; set; }
[Required]
public DateTime DateOfBirth { get; set; }
public bool IsSubscribed { get; set; }
public MembershipType MembershipType { get; set;}
public byte MembershipTypeId { get; set; }
}
为什么
onDb = _context.Customers.Single(c => c.Id == customer.Id);
填充MembershipType对象???我不希望这种情况发生。
是不是因为我之前已经为客户加载了相同的ID?