When upgrading from EF5 to EF6 should I replace System.Data.Objects?

后端 未结 3 553
别那么骄傲
别那么骄傲 2020-12-25 11:19

I am trying to replace EF5 with EF6 A lot of my code is giving type reference errors, Should I replace System.Data.Objects with System.Data.Entity.Core.Objects in my refere

相关标签:
3条回答
  • 2020-12-25 11:55

    A quote from the updating guide;

    The general rule for namespace changes is that any type in System.Data.* is moved to System.Data.Entity.Core.*. In other words, just insert Entity.Core. after System.Data.

    In other words, yes, you should update your references to the new namespace.

    0 讨论(0)
  • 2020-12-25 12:18

    One more change if you use DbGeography:

    System.Data.Objects     =>     System.Data.Entity.Core.Objects
    System.Data.EntityState    =>     System.Data.Entity.EntityState
    System.Data.Spatial.DbGeography    =>   System.Data.Entity.Spatial.DbGeography 
    
    0 讨论(0)
  • 2020-12-25 12:21

    Yes... You should update your references as follow:

    System.Data.Objects -> System.Data.Entity.Core.Objects
    System.Data.EntityState -> System.Data.Entity.EntityState
    
    0 讨论(0)
提交回复
热议问题