SQL Server到Entity Framework数据类型映射 [英] SQL Server to Entity Framework data type mapping
问题描述
1) ADO.NET中的数据类型映射
http ://msdn.microsoft.com/en-us/library/cc716729%28v=vs.110%29.aspx
2) .NET Framework中的SQL Server数据类型
http://msdn.microsoft.com/en-us/library/ms131092.aspx
实体框架将SQL Server数据类型映射到概念模型类型(Edm类型) 。该映射可以在这里找到:
Edm类型反过来可以直接转换为.NET类型(Boolean - > Boolean,Int32 - > Int32,Binary - > Byte数组等),可以在参考代码中找到:
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:
这篇关于SQL Server到Entity Framework数据类型映射的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!