public static CreateFeatureCommand ToCreateFeatureCommand(this CreateFeatureRequest createFeatureRequest)
 {
     return(new CreateFeatureCommand
     {
         Name = createFeatureRequest.Name,
         Path = createFeatureRequest.Path,
         CreatedBy = createFeatureRequest.CreatedBy,
     });
 }
        public async Task <IActionResult> Put([FromBody] CreateFeatureRequest createFeatureRequest)
        {
            createFeatureRequest.Validate();
            var command = createFeatureRequest.ToCreateFeatureCommand();

            await this._handleCommand.Handle(command);

            return(new StatusCodeResult((int)HttpStatusCode.Created));
        }
 public static void Validate(this CreateFeatureRequest createFeatureRequest)
 {
     createFeatureRequest.Required(nameof(createFeatureRequest));
     createFeatureRequest.Name.Required(nameof(createFeatureRequest.Name));
     createFeatureRequest.CreatedBy.Required(nameof(createFeatureRequest.CreatedBy));
 }