Exemplo n.º 1
0
        public IHttpActionResult GetAllDeviceTypes()
        {
            string cacheValue = RedisCacheHelper.GetValueByKey(cacheKey);

            if (string.IsNullOrEmpty(cacheValue) || cacheValue.Length < 10)
            {
                DeviceTypeModels deviceTypeModel = new Models.DeviceTypeModels();
                List <DeviceTypeModels.Detail> deviceTypeList = deviceTypeModel.GetAllDeviceType();
                RedisCacheHelper.SetKeyValue(cacheKey, new JavaScriptSerializer().Serialize(deviceTypeList));
                return(Ok(deviceTypeList));
            }
            else
            {
                return(Ok(new JavaScriptSerializer().Deserialize <Object>(cacheValue)));
            }
        }
Exemplo n.º 2
0
        public IHttpActionResult GetAllDeviceTypesBySuperAdmin()
        {
            DeviceTypeModels deviceTypeModel = new Models.DeviceTypeModels();

            return(Ok(deviceTypeModel.GetAllDeviceTypeBySuperAdmin()));
        }