コード例 #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)));
            }
        }
コード例 #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)));
            }
        }
コード例 #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)));
            }
        }
コード例 #4
0
 public SearchResultsRepository(RentAGym db)
 {
     this.db = db;
 }
コード例 #5
0
 public CityRepository(RentAGym db)
 {
     this.db = db;
 }