public IEnumerable <ItemTypeDTO> Get() { List <ItemTypeDTO> list = new List <ItemTypeDTO>(); foreach (ItemType i in ModelloDatiDbContext.ItemTypes) { list.Add(ItemTypeConverter.ConverToDTO(i)); } return(list); }
public ItemTypeDTO Modifica(int id, string categoria, string descrizione, string marca, string modello) { ItemType item = ModelloDatiDbContext.ItemTypes.Find(id); //ItemType item = new ItemType(); item.Categoria = categoria; item.Descrizione = descrizione; item.Marca = marca; item.Modello = modello; ModelloDatiDbContext.SaveChanges(); return(ItemTypeConverter.ConverToDTO(item)); }
public ItemTypeDTO Get(int id) { ItemType item = ModelloDatiDbContext.ItemTypes.Find(id); return(ItemTypeConverter.ConverToDTO(item)); }