Example #1
0
 public static ItemDto AsDtos(this mlItems item)
 {
     return(new ()
     {
         Code = item.Code,
         Name = item.Name,
         Price = item.Price,
         CreatedDate = item.CreatedDate
     });
 }
Example #2
0
        public ActionResult UpdateItem(Guid code, UpdateItemDto UpdateItem)
        {
            var existingItem = repository.GetItem(code);

            if (existingItem is null)
            {
                return(NotFound());
            }

            mlItems item = existingItem with
            {
                Name  = UpdateItem.Name,
                Price = UpdateItem.Price
            };

            repository.UpdateItem(code, item);
            return(NoContent());
        }