예제 #1
0
        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
            }));
        }
예제 #2
0
 public RenameProjectCommand(RenameProjectModel model, Guid id)
 {
     _model    = model;
     Timestamp = DateTime.UtcNow;
     Id        = id;
 }