【发布时间】:2017-03-30 15:45:21
【问题描述】:
如果我尝试将 JsonDictionary 属性添加到 .net Dictionary(Of Integer, MyClass),编译器会告诉我,无法应用该属性。这是为什么呢?
<JsonDictionary()>
Public ReadOnly Property monatswerte As Dictionary(Of Integer, MyClass)
我基本上找不到任何在线使用JsonDictionary的例子。
【问题讨论】:
-
我没用过,所以帮不上忙,但是source code有
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)],所以只能在类或接口上使用。如果(像我一样)您不知道如何使用它,也许这不是您正在寻找的答案 - 也许您应该询问您正在尝试解决的问题? :-)