public int CreateTheater(Contracts.Theater newTheater) { TheaterDal dal = new TheaterDal(); // Add the theater to the cache rwl.AcquireWriterLock(new TimeSpan(1, 0, 0)); if (HallCache[newTheater.ID.ToString()] != null) HallCache.Remove(newTheater.ID.ToString()); HallCache.Add(newTheater.ID.ToString(), newTheater, null, DateTime.Now.AddYears(1), Cache.NoSlidingExpiration, CacheItemPriority.High, null); rwl.ReleaseWriterLock(); return dal.CreateEntity(newTheater); }