Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id, Name, IsCompleted, Deadline")] TaskItem taskItem)
        {
            if (id != taskItem.Id)
            {
                return(NotFound());
            }

            var currentUser = await _userManager.GetUserAsync(User);

            if (!ModelState.IsValid)
            {
                return(View(taskItem));
            }

            try
            {
                await _taskService.Update(taskItem, currentUser);
            }
            catch (DbUpdateConcurrencyException)
            {
                throw;
            }
            return(RedirectToAction(nameof(Index)));
        }