Exemple #1
0
        public IEnumerable <ItemTypeDTO> Get()
        {
            List <ItemTypeDTO> list = new List <ItemTypeDTO>();

            foreach (ItemType i in ModelloDatiDbContext.ItemTypes)
            {
                list.Add(ItemTypeConverter.ConverToDTO(i));
            }
            return(list);
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        public ItemTypeDTO Get(int id)
        {
            ItemType item = ModelloDatiDbContext.ItemTypes.Find(id);

            return(ItemTypeConverter.ConverToDTO(item));
        }