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