Esempio n. 1
0
        public async Task <Servicio> DeleteServicio(int id)
        {
            var servicio = await _context.Servicios.FindAsync(id);

            _context.Entry(servicio).State = EntityState.Deleted;
            await _context.SaveChangesAsync();

            return(servicio);
        }
Esempio n. 2
0
        public virtual void Update(TEntity entity, List <string> modifiedfields)
        {
            context.Entry <TEntity>(entity).State = EntityState.Unchanged;

            foreach (string var in modifiedfields)
            {
                context.Entry <TEntity>(entity).Property(var).IsModified = true;
            }
        }
        public async Task <Pack> DeletePack(int id)
        {
            var pack = await _context.Packs.FindAsync(id);

            _context.Entry(pack).State = EntityState.Deleted;
            await _context.SaveChangesAsync();

            return(pack);
        }