【问题标题】:What is the difference when you add View with DataContextClass and without it?添加 View 和 DataContextClass 有什么区别?
【发布时间】:2019-03-18 09:28:56
【问题描述】:

我在没有 DataContextClass 的情况下添加我的所有视图,我想知道我将来是否会面临问题。

【问题讨论】:

    标签: asp.net-mvc


    【解决方案1】:

    From here =>

    如果您引用现有的 DbContext,那么向导将插入

    public DbSet<YourDbSet> YourDbSet { get; set; }

    如果它不存在于您的 DbContext 派生类中。看起来 Visual Visual Studio 做了一些工作。

    还有Microsoft documentation

    【讨论】:

    • @steve,我上面的回答对你有帮助吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-08-03
    • 2010-12-28
    • 2017-08-09
    相关资源
    最近更新 更多