Exemplo n.º 1
0
 public CreateAlterationsOrderCommandTest()
 {
     InvalidCommand = new CreateAlterationsOrderCommand
     {
         CustomerName   = "",
         CustomerEmail  = "NotAnEmail",
         AlterationSize = 0
     };
 }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([FromBody] CreateAlterationsOrderCommand createAlterationCommand)
        {
            if (createAlterationCommand is null)
            {
                return(BadRequest($"{nameof(createAlterationCommand)} must be valid"));
            }

            var alteration = await this._mediator.Send(createAlterationCommand);

            return(Created(alteration.Id.ToString(), alteration));
        }