索引Zumo EntityData中的特定字段

时间:2017-05-03 19:35:56

标签: azure-mobile-services

使用Microsoft.Azure.Mobile.Server EntityData,我有一个类似于

的类
public abstract class BaseItem : EntityData
{
    public string Owner { get; set; }
    public string Text { get; set; }
}

如何确保为所有者和文本编制索引?

更新。我想我可以添加[Index(IsClustered = false)]

1 个答案:

答案 0 :(得分:0)

使用标准的实体框架语义。

public class BaseItem : EntityData
{
   [Required]
   [Index]
   public string Owner { get; set; }
}

有关详细信息,请参阅http://www.entityframeworktutorial.net/code-first/dataannotation-in-code-first.aspx