Search code examples
c#ado.netc#-4.0entity-framework-4code-first

How to set data type property as smalldatetime


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

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

Solution

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