2012-07-07 106 views
2

我试图使用从ServiceStack.DataAnnotations ServiceStack的属性的装饰,但是当我看到在MSVS对象浏览器的ServiceStack.DataAnnotations命名空间,只有以下几种类型:ServiceStack.DataAnnotations缺少属性定义?

ComputeAttribute DecimalLengthAttribute IgnoreAttribute PrimaryKeyAttribute

我有最新的垃圾箱和我所有的参考资料。具体来说,我期待使用[AutoIncrement]和[Index]属性。

感谢

回答

2

的[自动递增]和[索引]属性是在免费的依赖,ServiceStack.Interfaces.dllServiceStack.Interfaces.DataAnnotations命名它,如果你使用的NuGet可以找到ServiceStack.Common NuGet package内。

+0

是否有一个原因,例如PrimaryKey放在ServiceStack.DataAnnotations中,其他属性(Index等)放在另一个DLL中?为什么不把他们全部放在同一个地方?任何想法? – Ted 2013-11-10 16:05:54

+1

@Ted In ** v4 **所有OrmLite属性都可在[ServiceStack.Interfaces](https://github.com/ServiceStack/ServiceStack/tree/master/src/ServiceStack.Interfaces/DataAnnotations)中找到。 – mythz 2013-11-10 16:21:00