CSLA4.3中使用集合类型列表和字典(list,Dictionary)

来源:互联网 发布:淘宝卖家快递费用 编辑:程序博客网 时间:2024/06/15 08:21

CSLA4.3中使用集合类型列表和字典(list,Dictionary)

使用集合类型作为属性传递数据,

list<>对应:Csla.Core.MobileList

MobileDictionary<>对应:Csla.Core.MobileDictionary

示例:

  public static PropertyInfo<MobileList<int>> TasksProperty = RegisterProperty<MobileList<int>>(c => c.Tasks);

        public MobileList<int> Tasks
        {
            get { return ReadProperty(TasksProperty); }
            set { LoadProperty(TasksProperty, value); }

        }


 public static PropertyInfo<MobileDictionary<string, string>> ValuesProperty = RegisterProperty<MobileDictionary<string, string>>(c => c.Values);
        public  MobileDictionary<string,string> Values
        {
            get { return ReadProperty(ValuesProperty); }
            set { LoadProperty(ValuesProperty, value); }
        }