Ejemplo n.º 1
0
        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)));
            }
        }
Ejemplo n.º 2
0
        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)));
            }
        }
Ejemplo n.º 3
0
        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;
 }
Ejemplo n.º 5
0
 public CityRepository(RentAGym db)
 {
     this.db = db;
 }