public async Task <IHttpActionResult> Get(int id) { try { string rawKey = "CacheById"; IVehicleMake vehicleMake = Caching.GetCacheItem(rawKey, MasterCacheKeyArray) as IVehicleMake; if (vehicleMake == null) { vehicleMake = await VehicleMakeService.GetByIdAsync(id); if (vehicleMake == null) { return(NotFound()); } Caching.AddCacheItem(rawKey, vehicleMake, MasterCacheKeyArray); } return(Ok(vehicleMake)); } catch (Exception ex) { LogError.LogError(ex); return(BadRequest(ex.Message)); } }