Example #1
0
        /// <summary>添加泛型数据池
        /// </summary>
        public DataPoolOption AddDescriptor <T>(Func <T, string> idSelector, string group = "", string processGroup = "") where T : class, new()
        {
            var descriptor = new GenericsDataPoolDescriptor <T>()
            {
                Group                      = group,
                DataType                   = typeof(T),
                GenericsDataPoolType       = typeof(IGenericsDataPool <T>),
                GenericsDataPoolOptionType = typeof(GenericsDataPoolOption <T>),
                ProcessGroup               = processGroup,
                IdSelector                 = idSelector
            };

            return(AddDescriptor <T>(descriptor));
        }
Example #2
0
 /// <summary>添加泛型数据池
 /// </summary>
 public DataPoolOption AddDescriptor <T>(GenericsDataPoolDescriptor <T> descriptor) where T : class, new()
 {
     Descriptors.Add(descriptor);
     return(this);
 }