internal void SetOwner(ObjectRepositoryBase owner) { if (ObjectRepository != null) { throw new InvalidOperationException("ObjectRepository already set!"); } ObjectRepository = owner; }
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); }
public static TableDictionary <T> ToConcurrentTable <T>(this IEnumerable <T> source, ObjectRepositoryBase owner) where T : ModelBase => new TableDictionary <T>(owner, source);
protected TableDictionary(ObjectRepositoryBase owner) { _owner = owner; _foreignIndexes = new ConcurrentDictionary <Type, ConcurrentDictionary <string, Tuple <Delegate, object> > >(); }