3

有办法吗?以下不起作用:

var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).DataType("smalldatetime");
4

2 回答 2

5
customer.Property(c => c.Date).HasStoreType("smalldatetime");
于 2010-05-17T23:04:47.157 回答
2

我的代码优先方法:

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

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

}
于 2018-03-29T06:26:08.083 回答