public Task <bool> Handle(CreatePenCommand request, CancellationToken cancellationToken)
        {
            var pen = new Pen()
            {
                Manufacturer = request.Manufacturer,
                Model        = request.Model,
                Description  = request.Description,
                ImageUrl     = request.ImageUrl
            };

            _penRepository.Add(pen);

            return(Task.FromResult(true));
        }
Ejemplo n.º 2
0
 public JsonResult Add([FromQuery] Pen pen)
 {
     _penRepository.Add(pen);
     return(new JsonResult(pen));
 }