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); }
public static void UpdateArea(RealArea area) { realAreasCache.Remove(area); }