SQL Server to Entity Framework data type mapping

.net asp.net c# entity-framework sql-server

Question

I need to know the equivalent SQL Server data types for EF. I found 2 similar online references, but their definitions appear inconsistent. Which reference should I refer to if I'm using Entity Framework?

1) Data Type Mappings in ADO.NET

http://msdn.microsoft.com/en-us/library/cc716729%28v=vs.110%29.aspx

2) SQL Server Data Types in the .NET Framework

http://msdn.microsoft.com/en-us/library/ms131092.aspx

1
4
10/18/2014 8:40:08 AM

Popular Answer

Neither of those.

Entity Framework maps SQL Server data types to conceptual model types ("Edm types"). The mapping can be found here:

Edm types in turn translate to .NET types in a straightforward way (Boolean -> Boolean, Int32 -> Int32, Binary -> Byte array, etc.) and can be found in the reference code:

5
7/27/2016 10:02:33 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow