public async Task <IActionResult> Create(UserTask userTask) { if (userTask == null) { return(NotFound()); } var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } UserTaskForCreateDTO userTaskCreate = new UserTaskForCreateDTO(); userTaskCreate.Title = userTask.Title; userTaskCreate.Description = userTask.Description; userTaskCreate.UserID = user.Id; var userTaskSerialize = JsonConvert.SerializeObject(userTaskCreate); _webAPI.AssignAuth(user.UserName); await _webAPI.PostRequest(userTaskSerialize); return(RedirectToAction(nameof(Index))); }