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