示例#1
0
        public async Task <IActionResult> SetLayoutView(LayoutView view)
        {
            Response.Cookies.Append(LayoutCookieKey, view.GetEnumMemberValue());

            var user = await _userManager.GetUserAsync(HttpContext.User);

            if (user == null)
            {
                return(Json(new { Success = true }));
            }
            user.Settings.LayoutView = view;
            await _userManager.UpdateAsync(user);

            return(Json(new { Success = true }));
        }