public ValidationResult Handler(CreateTypeCommand command) { Type type = new Type(command.Definicion, command.Icon); Boolean result = _typeRepository.Create(type); return(Validate(type)); }
public async Task <ActionResult <Guid> > Create([FromBody] CreateTypeCommand command) { var productId = await Mediator.Send(command); return(Ok(productId)); }
public ValidationResult Create( [FromBody] CreateTypeCommand createTypeCommand, [FromServices] CreateTypeHandler createTypeHandler) { return(createTypeHandler.Handler(createTypeCommand)); }