示例#1
0
        public RealArea GetArea(int id)
        {
            RealArea cachedArea = realAreasCache.Find(area => area.Id == id);

            if (cachedArea == null)
            {
                RealArea newArea = AreaUtils.AreaToRealArea(areaController.getById(id), subAreaController, userController);
                realAreasCache.Add(newArea);
                System.Diagnostics.Debug.WriteLine("Area fetched is:" + newArea.name);
                return(newArea);
            }
            System.Diagnostics.Debug.WriteLine("Area cached is:" + cachedArea.name);
            return(cachedArea);
        }
示例#2
0
 public static void UpdateArea(RealArea area)
 {
     realAreasCache.Remove(area);
 }