public async Task <ActionResult> GetDeviceListColumns()
        {
            var userId  = PrincipalHelper.GetEmailAddress(User);
            var columns = await _userSettingsLogic.GetDeviceListColumnsAsync(userId);

            return(PartialView("_DeviceListColumns", JsonConvert.SerializeObject(columns, new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            })));
        }
Exemple #2
0
        public async Task <HttpResponseMessage> GetDeviceListColumns()
        {
            var userId = PrincipalHelper.GetEmailAddress(User);

            return(await GetServiceResponseAsync <IEnumerable <DeviceListColumns> >(async() =>
            {
                var columns = await _userSettingsLogic.GetDeviceListColumnsAsync(userId);

                if (columns == null || columns.Count() == 0)
                {
                    columns = defaultColumns;
                    await _userSettingsLogic.SetDeviceListColumnsAsync(userId, columns);
                }

                return columns;
            }));
        }