Esempio n. 1
0
        public IDBEntityCollection <T> GetByType <T>()
            where T : IDBEntity
        {
            IDBEntityCollection dbEntityCollection = null;

            EntityCollections.TryGetValue(nameof(T), out dbEntityCollection);
            if (dbEntityCollection == null)
            {
                throw new CollectionNotRegisteredException($"Collection {nameof(T)} not found in Database");
            }

            return(dbEntityCollection as IDBEntityCollection <T>);
        }
Esempio n. 2
0
 public void Register(IDBEntityCollection collection)
 {
     collection.Initialize();
     EntityCollections.TryAdd(nameof(collection), collection);
 }