【发布时间】:2018-03-29 14:26:08
【问题描述】:
有办法吗?以下不起作用:
var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).DataType("smalldatetime");
【问题讨论】:
标签: c# ado.net c#-4.0 entity-framework-4 code-first
有办法吗?以下不起作用:
var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).DataType("smalldatetime");
【问题讨论】:
标签: c# ado.net c#-4.0 entity-framework-4 code-first
customer.Property(c => c.Date).HasStoreType("smalldatetime");
【讨论】:
我的代码优先方法:
[Table("Customer", Schema = "DBSchema")]
public class Customer{
[Column("Date", TypeName = "SmallDateTime")]
public DateTime Date{ get; set; }
}
【讨论】: