public AddressRepository(RentAGym db) { this.db = db; // pre-load addresses from database as a normal // Dictionary with AddressID is the key, // then convert to a thread-safe ConcurrentDictionary if (addressesCache == null) { addressesCache = new ConcurrentDictionary <string, Address>( db.Addresses.ToDictionary(c => Convert.ToString(c.AddressId))); } }
public SpaceRepository(RentAGym db) { this.db = db; // pre-load spaces from database as a normal // Dictionary with SpaceID is the key, // then convert to a thread-safe ConcurrentDictionary if (spacesCaches == null) { spacesCaches = new ConcurrentDictionary <string, Space>( db.Spaces.ToDictionary(s => Convert.ToString(s.SpaceId))); } }
public SpaceTypeRepository(RentAGym db) { this.db = db; // pre-load SpaceTypes from database as a normal // Dictionary with AddressID is the key, // then convert to a thread-safe ConcurrentDictionary if (spaceTypesCache == null) { spaceTypesCache = new ConcurrentDictionary <string, SpaceType>( db.SpaceTypes.ToDictionary(sp => sp.Type)); // addressesCache = new ConcurrentDictionary<string, Address>( // db.Addresses.ToDictionary(sp => Convert.ToString(sp.Type))); } }
public SearchResultsRepository(RentAGym db) { this.db = db; }
public CityRepository(RentAGym db) { this.db = db; }