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>); }
public void Register(IDBEntityCollection collection) { collection.Initialize(); EntityCollections.TryAdd(nameof(collection), collection); }