1、sqlserver中nvarchar(50),对应EF中:
[MaxLength(50, ErrorMessage = "最大长度为{1}")] public string Name { get; set; }
2、sqlserver中char(10),对应EF中:
[MaxLength(10)] [Column(TypeName = "CHAR")] public string Name { get; set; }
3、sqlserver中smallint,对应EF中:
public short ID { set; get; }
4、sqlserver中tinyint,对应EF中:
public byte IsDelete { get; set; }
5、sqlserver中text,对应EF中:
[Column(TypeName = "text")] public string Content { set; get; }
6、sqlserver中Date(sqlserver2008版本以上才有),对应EF中:
[Column(TypeName = "Date")] public DateTime Birthday{ get; set; }