Mik*_*ike 5 c# entity-framework
我首先使用Entity Framework 6.1.1和Code.EF 6.1应该添加对Index属性的支持,但编辑器自动完成或编译器都不接受[Index]属性,例如:
[Index]
public DateTime TimeOfSale { get; set; }
Run Code Online (Sandbox Code Playgroud)
所有项目引用都指向EF 6.1.1的DLL.
我也在运行SQL Server Compact Edition 4.0.
如何启用新的[Index]属性?
当KeyAttribute它位于System.ComponentModel.DataAnnotations命名空间中时,IndexAttribute该类位于System.ComponentModel.DataAnnotations.Schema命名空间中.您可能会遗漏以下using声明:
using System.ComponentModel.DataAnnotations.Schema;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5238 次 |
| 最近记录: |