public static ItemDto AsDtos(this mlItems item) { return(new () { Code = item.Code, Name = item.Name, Price = item.Price, CreatedDate = item.CreatedDate }); }
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()); }