コード例 #1
0
 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));
 }
コード例 #2
0
        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));
        }
コード例 #3
0
 public static AssignIsLowerThanStrategyToFeatureCommand ToAssignIsLowerThanStrategyToFeatureCommand(this AssignIsLowerThanStrategyToFeatureRequest request)
 {
     return(new AssignIsLowerThanStrategyToFeatureCommand
     {
         Name = request.Name,
         Path = request.Path,
         AssignedBy = request.AssignedBy,
         Value = request.Value.GetValueOrDefault()
     });
 }