public static void Validate(this AssignIsLowerThanStrategyToFeatureRequest request) { request.Required(nameof(request)); request.Name.Required(nameof(request.Name)); request.Value.Required(nameof(request.Value)); request.AssignedBy.Required(nameof(request.AssignedBy)); }
public async Task <IActionResult> Post([FromBody] AssignIsLowerThanStrategyToFeatureRequest request) { request.Validate(); var command = request.ToAssignIsLowerThanStrategyToFeatureCommand(); await this._handleCommand.Handle(command); return(new StatusCodeResult((int)HttpStatusCode.OK)); }
public static AssignIsLowerThanStrategyToFeatureCommand ToAssignIsLowerThanStrategyToFeatureCommand(this AssignIsLowerThanStrategyToFeatureRequest request) { return(new AssignIsLowerThanStrategyToFeatureCommand { Name = request.Name, Path = request.Path, AssignedBy = request.AssignedBy, Value = request.Value.GetValueOrDefault() }); }