<分区>
当我将 Entity Framework 用作 ORM 时,对于我的 SQL Server 数据库中的每个 Date
数据类型,它都会创建一个 DateTime
数据类型 y
在我的 MVC 项目中。
我的意思是,对于我的数据库中的每个表,在我的 MVC 项目中使用 DateTime
数据类型自动生成此类的代码,但我不需要时间,只需要日期。
所以我的问题是:我该怎么做才能将此字段声明为仅Date
数据类型或通常如何处理这种情况?
public partial class Employee
{
public int Id_Employee { get; set; }
public string Name { get; set; }
public string Last_Name { get; set; }
public Nullable<System.DateTime> B_Date { get; set; }
public Nullable<int> SSN_L4 { get; set; }
public string Phone_N { get; set; }
public string Adress_L1 { get; set; }
public string Adress_City { get; set; }
}