祝大家新年快乐。好的,我正在尝试创建一个 3 层应用程序,并且我的引用按以下顺序 UI -> BLL -> DAL。问题是。我遇到的问题是 Dbset。因为我在 DAL 中没有引用我的模型,所以 dbset 失败。
namespace MyApp.DAL
{
public class MyAppDb : DbContext
{
public MyAppDb() : base("name=MyAppDBstring")
{ }
public DbSet<SomeModel> SomeModels { get; set; }
}
}
如果它在我的 BLL 中找不到我的 SomeModel 类,我该如何让它工作?任何帮助将不胜感激。