コード例 #1
0
        public async Task <JsonResult> OnPostAsync(string itemId)
        {
            ApplicationUser = await UserManager.GetUserAsync(User);

            Item item = DataAcces.GetItem(itemId);

            ApplicationUser.Items = ApplicationUser.EraseItem(item);
            IdentityResult identityResult = await UserManager.UpdateAsync(ApplicationUser);

            if (identityResult.Succeeded)
            {
                return(new JsonResult(item.Price));
            }
            else
            {
                return(null);
            }
        }