0
我喜歡使用自定義的IDictionary類我DynamicComponent映射:如何使用自定義詞典類的DynamicComponent映射
class ObservableDictionary : Hashtable, INotifyCollectionChanged, INotifyPropertyChanged
映射列表時有可能按如下方式使用自定義集合類型:
mapping.HasMany(x => x.Items).CollectionType<ObservableCollection<ItemClass>>();
但我怎麼能用DynamicComponents做到這一點?沒有CollectionType方法。
mapping.DynamicComponent(
x => x.DynamicFields,
c => {
c.Map(x => x["fld_num"]).CustomType(typeof(int));
c.Map(x => x["shortdesc"]).CustomType(typeof(string));
});