【发布时间】:2016-12-01 02:43:13
【问题描述】:
我在 C# 中使用了 ArangoDB.Client。 我正在创建一个资源类并将 ResourceId 和 Locale 作为复合键。
public class Resource
{
[Key, Column(Order = 1)]
public Guid ResourceId {get; set;}
[Key, Column(Order = 2)]
[MaxLength(5)]
public string Locale {get; set;}
public string ResourceName {get; set;}
}
以上级别不起作用。我必须使用如下,并且需要结合 ResourceId 和 Locale 来保存为键。
public class Resource
{
[DocumentProperty(Identifier = IdentifierType.Key)]
public string Key { get; set; }
public Guid ResourceId {get; set;}
[MaxLength(5)]
public string Locale {get; set;}
public string ResourceName {get; set;}
}
请提出任何其他想法!
【问题讨论】:
-
ResourceIdtype 是Guid本身就已经是独一无二的了,为什么还要和Locale结合呢?
标签: c# arangodb composite-key