Ejemplo n.º 1
0
        public ActionResult <ItemDto> CreateItem(CreateItemDto itemDto)
        {
            Item item = new(){
                Id          = Guid.NewGuid(),
                Name        = itemDto.Name,
                Price       = itemDto.Price,
                CreatedDate = DateTimeOffset.UtcNow
            };

            repository.CrateItem(item);
            return(CreatedAtAction(nameof(GetItems), new{ id = item.Id }, item.ASDto()));
        }