public async Task <IActionResult> Post(AddWorkshopModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (model.CommandId == Guid.Empty) { model.CommandId = NewId.NextGuid(); } var command = new AddWorkshopCommand(model); await Send(command); return(Accepted(new PostResult <AddWorkshopCommand>() { CommandId = model.Id, Timestamp = command.Timestamp })); }
public AddWorkshopCommand(AddWorkshopModel model) { _model = model; Timestamp = DateTime.UtcNow; }