コード例 #1
0
 internal void SetOwner(ObjectRepositoryBase owner)
 {
     if (ObjectRepository != null)
     {
         throw new InvalidOperationException("ObjectRepository already set!");
     }
     ObjectRepository = owner;
 }
コード例 #2
0
        public TableDictionary(ObjectRepositoryBase owner, IEnumerable <T> source) : base(owner)
        {
            _owner      = owner;
            _dictionary = new ConcurrentDictionary <BaseEntity, T>(source.Select(v => new KeyValuePair <BaseEntity, T>(v.Entity, v)));

            _columnsForIndex = new ConcurrentDictionary <string, Func <T, object> >();

            _indexes = new ConcurrentDictionary <string, ConcurrentDictionary <object, T> >();

            AddIndex(() => x => x.Id);
        }
コード例 #3
0
 public static TableDictionary <T> ToConcurrentTable <T>(this IEnumerable <T> source, ObjectRepositoryBase owner) where T : ModelBase => new TableDictionary <T>(owner, source);
コード例 #4
0
 protected TableDictionary(ObjectRepositoryBase owner)
 {
     _owner          = owner;
     _foreignIndexes = new ConcurrentDictionary <Type, ConcurrentDictionary <string, Tuple <Delegate, object> > >();
 }