问题
I'm trying to use ServiceStack's attribute decorators from ServiceStack.DataAnnotations but when I view the ServiceStack.DataAnnotations namespace in the MSVS Object Browser, there are only the following types:
ComputeAttribute DecimalLengthAttribute IgnoreAttribute PrimaryKeyAttribute
I have the latest bins and all of my references check out. Specifically, I'm looking to use the [AutoIncrement] and [Index] attribs.
Thanks
回答1:
The [AutoIncrement] and [Index] attributes are in the ServiceStack.Interfaces.DataAnnotations namespace in the dependency-free ServiceStack.Interfaces.dll which if you're using NuGet you can find inside the ServiceStack.Common NuGet package.
来源:https://stackoverflow.com/questions/11378284/servicestack-dataannotations-missing-attributes-definitions