public ValidationResult Handler(CreateTypeCommand command)
        {
            Type type = new Type(command.Definicion, command.Icon);

            Boolean result = _typeRepository.Create(type);

            return(Validate(type));
        }
Пример #2
0
        public async Task <ActionResult <Guid> > Create([FromBody] CreateTypeCommand command)
        {
            var productId = await Mediator.Send(command);

            return(Ok(productId));
        }
Пример #3
0
 public ValidationResult Create(
     [FromBody] CreateTypeCommand createTypeCommand,
     [FromServices] CreateTypeHandler createTypeHandler)
 {
     return(createTypeHandler.Handler(createTypeCommand));
 }