我有两节课:
public class Product : Base
{
public string Name { get; set; }
public string Description { get; set; }
public virtual List<Ingredient> Ingredients { get; set; }
}
和
public class Ingredient:Base
{
public string Description { get; set; }
}
我的问题是:插入/更新产品成分的最佳方式是什么?假设我需要在插入/更新之前验证产品和成分,我应该创建一个产品存储库还是一个产品存储库和成分存储库?
我看到当我在我的控制器中使用我的 DbContext 时这很容易.. 但是如果我需要一个由 modules(bl,dao) 制作的系统?