سؤال

After uptade Entity framework any version to Entity Framework in existing project in MYDATABASE.edmx When I update model from database Visual studio generates using lines such as

  using System.Data.Objects;   
  using System.Data.Objects.DataClasses;

but Here is should be:

using System.Data.Entity.Core.Objects;
هل كانت مفيدة؟

المحلول

1.Open MYDATABASE.Context.tt (Your code generation template) (Under the MYDATABASE.edmx)

2.Find invalid references like this

{
#>
using System.Data.Objects;   
using System.Data.Objects.DataClasses;
using System.Linq;
<#
}

3.Replace like this

{
#>
using System.Data.Entity.Core.Objects;
using System.Linq;
<#
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top