【发布时间】:2015-02-25 12:48:36
【问题描述】:
我使用的是 Entity Framework 6.1 代码优先,我的域模型如下。
class Item
{
[Index]
public string CreatedBy { set; get; }
}
当我使用 update-database 进行迁移时,我收到以下错误。但是据我研究,[Index] 应该作为string 的注释。
表 'dbo.Items' 中的列 'CreatedBy' 的类型不能用作索引中的键列。
【问题讨论】:
标签: c# sql-server performance entity-framework indexing