【问题标题】:ServiceStack.DataAnnotations missing attributes definitions?ServiceStack.DataAnnotations 缺少属性定义?
【发布时间】:2012-07-09 22:51:31
【问题描述】:

我正在尝试使用来自 ServiceStack.DataAnnotations 的 ServiceStack 的属性装饰器,但是当我在 MSVS 对象浏览器中查看 ServiceStack.DataAnnotations 命名空间时,只有以下类型:

计算属性 十进制长度属性 忽略属性 主键属性

我有最新的垃圾箱,我的所有参考资料都已签出。具体来说,我希望使用 [AutoIncrement] 和 [Index] 属性。

谢谢

【问题讨论】:

    标签: c# attributes servicestack


    【解决方案1】:

    [AutoIncrement] 和 [Index] 属性位于无依赖项 ServiceStack.Interfaces.dllServiceStack.Interfaces.DataAnnotations 命名空间中,如果您使用 NuGet,您可以在 @987654322 中找到@。

    【讨论】:

    • 是否有理由将例如 PrimaryKey 放置在 ServiceStack.DataAnnotations 中,而将其他属性(索引等)放置在另一个 DLL 中?为什么不把它们都放在同一个地方?有什么想法吗?
    • @Ted In v4 所有 OrmLite 属性在 ServiceStack.Interfaces 中可用。
    猜你喜欢
    • 2016-03-19
    • 1970-01-01
    • 2019-03-04
    • 2019-12-11
    • 1970-01-01
    • 2021-10-29
    • 1970-01-01
    • 2021-04-25
    • 2018-07-19
    相关资源
    最近更新 更多