简体   繁体   中英

SQL Server to Entity Framework data type mapping

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

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM