How to set a data type property as smalldatetime

Is there any way? The following does not work:

var customer = constructor.Entity<Customer>();
customer.Property(c => c.Date).DataType("smalldatetime");
+3
source share
2 answers
customer.Property(c => c.Date).HasStoreType("smalldatetime");
+5
source

My first approach to the code:

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

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

}
0
source

Source: https://habr.com/ru/post/1745289/


All Articles