冬眠Rhinos Profiler柱类型不匹配警告

时间:2015-10-28 20:09:27

标签: c# .net entity-framework profiler

当我运行实体框架分析器时,我会丢失列类型不匹配错误,这显然会影响性能 http://hibernatingrhinos.com/products/EFProf/learn/alert/ColumnTypeMismatch

所以我尝试使用属性将我的实体与数据库匹配,但我仍然收到警告。

[Key, Required, Column(TypeName = "nvarchar"), StringLength(25)]
public virtual string UserLoginName { get; set; }

[Column(TypeName = "nvarchar"), StringLength(50)]
public virtual string FirstName { get; set; }

[Column(TypeName = "nvarchar"), StringLength(50)]
public virtual string LastName { get; set; }

[Column("UserType", TypeName = "int")]
public virtual CompanyType? CompanyType { get; set; } // this is a ENUM nut maps to a int is this correct to map to int?

public virtual ICollection<Permits> Permits { get; set; } // navigation property so no attributes?

[Column(TypeName = "DateTime2")]
public virtual DateTime? DOB{ get; set; } // is it correct to map datetime to Datetime2?

[Column(TypeName = "nvarchar(MAX)")]
public virtual string Notes { get; set; }

0 个答案:

没有答案