开发者

How to set data type property as smalldatetime

开发者 https://www.devze.com 2022-12-30 00:01 出处:网络
Is there a way? The following doesn\'t work: var customer = constructor.Entity<Customer>(); customer.Property(c => c.Date).Da开发者_Python百科taType(\"smalldatetime\");

Is there a way? The following doesn't work:

var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).Da开发者_Python百科taType("smalldatetime");


customer.Property(c => c.Date).HasStoreType("smalldatetime");


My code first approach:

[Table("Customer", Schema = "DBSchema")]
public class Customer{

    [Column("Date", TypeName = "SmallDateTime")]   
    public DateTime Date{ get; set; }

}
0

精彩评论

暂无评论...
验证码 换一张
取 消