Type mapPing rules from this table are used when generating a model from a database with Entity Data Model Wizard in Visual Studio 2008 - 2015 and Create Model Wizard in Entity Developer.
Postgresql data types | SSDL1 | CSDL .NET | |
---|---|---|---|
boolean | Boolean | System.Boolean | |
smallint,int2 | smallint | Int16 | System.Int16 |
integer,int4 | int | Int32 | System.Int32 |
bigint,int8 | bigint | Int64 | System.Int64 |
real | Single | System.Single | |
double precision,money | double precision | Double | System.Double |
numeric,decimal,float | Decimal | System.Decimal | |
date,timestamp,timestamp with time zone,timestamp without time zone | DateTime | System.DateTime | |
time,time with time zone,time without time zone,interval | Time | System.TimeSpan | |
timestamp with time zone | datetimeoffset | DateTimeOffset | System.DateTimeOffset |
char,varchar,text,citext,enum,bit,varbit,cidr,inet,macaddr,point,line,lseg,box,path,polygon,circle,xml*,character,character varying,bit varying,json,jsonb | String | System.String | |
bytea | Binary | System.Byte[] | |
uuid2 | uuID | GuID | System.GuID |
geometry3 | spatial_geometry | Geometry,GeometryCollection,Geometrylinestring,GeometryMultilinestring,GeometryMultiPoint,GeometryMultipolygon,GeometryPoint,Geometrypolygon | System.Data.Spatial.DbGeometry |
geography spatial_geography | Geography,GeographyCollection,GeographyLineString,GeographyMultiLineString,GeographyMultiPoint,GeographyMultiPolygon,GeographyPoint,GeographyPolygon | System.Data.Spatial.DbGeography |
1Note that when mapPing corresponding database data type,you will need the .NET type with larger precision. That is because,for example,any Int32 value can be stored in the NUMBER(10) column,but largest NUMBER(10) column value cannot be stored in the Int32 fIEld,it requires Int64 fIEld.
2UuID and xml data types appeared in Postgresql 8.3.
3Supported in Entity Framework v5 and v6.
.NET to Postgresql default type mapPing .NET | CSDL SSDL PostgreSQL data types | |||
---|---|---|---|---|
System.Boolean | boolean | |||
System.Byte | Byte | byte | smallint | |
System.Byte[] | bytea | |||
System.Data.Spatial.DbGeometry Geometry | geometry | |||
System.Data.Spatial.DbGeography Geography | geography | |||
System.DateTime | timestamp | timestamp | ||
System.DateTimeOffset | timestamp with time zone | |||
System.Decimal | numeric | numeric | ||
System.Double | double precision | |||
System.Guid | uuid | |||
System.Int16 | System.Int32 | integer | ||
System.Int64 | bigint | |||
System.SByte | SByte | sbyte | System.Single | real |
System.String | ||||
System.TimeSpan | timestamp |
2Supported in Entity Framework v5 and v6.
DateTimeOffcet type is not supported.
总结以上是内存溢出为你收集整理的PostgreSQL to .NET type mapping全部内容,希望文章能够帮你解决PostgreSQL to .NET type mapping所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)