Пример #1
0
        /// <summary>
        /// Update wishList name
        /// </summary>
        /// <param name="wishName"></param>
        /// <returns></returns>
        public async Task <IActionResult> OnPostUpdateName(string wishName)
        {
            WishListModel = await _wishListViewModelService.GetOrCreateWishListForUser(User.Identity.Name);

            var cleanWishName = string.IsNullOrEmpty(wishName)?"":wishName.Trim();

            if (WishListModel.WishName != cleanWishName)
            {
                await _wishListService.SetWishName(WishListModel.Id, cleanWishName);

                WishListModel = await _wishListViewModelService.GetOrCreateWishListForUser(User.Identity.Name);
            }
            return(RedirectToPage());
        }