Entity Framework Code First Date field creation

后端 未结 8 2274
情歌与酒
情歌与酒 2020-11-30 23:13

I am using Entity Framework Code First method to create my database table. The following code creates a DATETIME column in the database, but I want to create a

8条回答
  •  醉梦人生
    2020-12-01 00:03

    the Best Way it using The

    [DataType(DataType.Date)]
    public DateTime ReportDate { get; set; }
    

    but you must using the EntityFramework v 6.1.1

提交回复
热议问题