public async Task <IActionResult> Add(ToDoThingViewModel toDoThingViewModel) { var user = await GetCurrentUserAsync(); // holding on to createdId for now because we could use it to pass along to a details view. var createdId = await _mediator.Send(new AddToDoThingByUserIdCommandAsync(user.Id, toDoThingViewModel)); _logger.LogInformation(SomeConstLogeventId, "Added a new ToDoThing", createdId); return(RedirectToAction("Index")); }
public AddToDoThingByUserIdCommandAsync(string userId, ToDoThingViewModel toDoThingViewModel) { UserId = userId; ToDoThingViewModel = toDoThingViewModel; }