I'm following Microsoft Guide and it mentions that
Ensure that assembly references to System.Data.Entity.dll are removed
The general rule for namespace changes is that any type in System.Data.* is moved to System.Data.Entity.Core.*.
But my projects are using ADO.NET Objects such as:
- 'DbException'
- 'DataException'
- 'DbCommand'
- 'IDbDataParameter'
- 'DbType'
- 'IDbCommand'
How can I replace them? I'm looking these namespaces
System.Data.Entity.Core.EntityClient
Microsoft.Data.SqlClient
But couldn't find any replacement.
Is it still okay to use System.Data and System.Data.Common namespaces? If not, how can I replace them?
Below fragment from that Upgrading to Entity Framework 6 article, is to be read as that the mentioned namespace changes are to be applied on types that are in the
System.Data.*namespace and originate from theSystem.Data.Entity.dllassembly.The
System.Data.Commonnamespace of e.g. theDbExceptiontype matches that namespace, butDbExceptionis in theSystem.Data.Common.dllassembly, not inSystem.Data.Entity.dll.For that reason
DbExceptionis still fine to be used, as are the other types you mentioned.Entity Framework 6 itself makes use of types from the
System.Data.Commonnamespace, see GitHubThat article also has below note about the
System.Datanamespace.