因为我的英语不好,我直截了当.为何记录公司在数据库中创建新记录和客户记录是否参考新公司记录?感谢帮助 :)
public class Company : EntityBase
{
public string Name { get; set; }
public List<Customer> Customers { get; set; }
public List<Invoice> Invoices { get; set; }
}
public class Customer : EntityBase
{
public string Name { get; set; }
public Company Company { get; set; }
public List<Card> Cards { get; set; }
}
public class EFRepositoryBase<TEntity> where TEntity : class, IEntity, new()
{
protected IUnitOfWork UnitOfWork { get; set; }
protected BenzineFleetContext Context
{
get …Run Code Online (Sandbox Code Playgroud)