在Database First中更改导航属性名称

时间:2016-01-27 19:41:23

标签: asp.net-mvc-5 ef-database-first domain-model

我有点问题。我有项目解决方案

  • BusinessLayer
  • DataAccessLayer
  • 域名模型

我的DataAccessLayer包含带有模型类的edmx文件和DomainModel tt文件。

我根据Improve navigation property names when reverse engineering a database更改了tt文件 然后我得到一个错误..模型不是上下文异常的一部分。

这是抛出异常的代码:

public static TestViewModel GetTestByPIN(string pin)
    {

        TestViewModel clFO = new TestViewModel();


        var client = from cl in db.Tests
                     where cl.PIN == pin
                     select cl;

有人能帮助我吗?

0 个答案:

没有答案
相关问题