Пример #1
0
 public Participacao create(Participacao model)
 {
     using (var db = new SistemaDeEventosContext())
     {
         db.Participacoes.Add(model);
         db.SaveChanges();
         return(model);
     }
 }
Пример #2
0
 public CategoriaEvento create(CategoriaEvento model)
 {
     using (var db = new SistemaDeEventosContext())
     {
         db.CategoriaEventos.Add(model);
         db.SaveChanges();
         return(model);
     }
 }
Пример #3
0
 public Evento Inserir(Evento model)
 {
     using (var db = new SistemaDeEventosContext())
     {
         db.Eventos.Add(model);
         db.SaveChanges();
         return(model);
     }
 }
 public Evento Atualizar(Evento model)
 {
     using (var db = new SistemaDeEventosContext())
     {
         db.Entry(model).State = EntityState.Modified;
         db.Eventos.Include(x => x.IdCategoriaEventoNavigation).Include(x => x.IdEventoStatusNavigation).ToList();
         db.SaveChanges();
         return(model);
     }
 }
 public Evento Inserir(Evento model)
 {
     using (var db = new SistemaDeEventosContext())
     {
         db.Eventos.Add(model);
         db.SaveChanges();
         db.Eventos.Include(x => x.IdCategoriaEventoNavigation).Include(x => x.IdEventoStatusNavigation).ToList();
         return(model);
     }
 }
Пример #6
0
        public bool delete(Participacao model)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.Entry(model).State = EntityState.Deleted;

                db.SaveChanges();

                return(true);
            }
        }
Пример #7
0
        public Participacao update(Participacao model)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.Entry(model).State = EntityState.Modified;

                db.SaveChanges();

                return(model);
            }
        }
Пример #8
0
        public CategoriaEvento update(CategoriaEvento model)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.Entry(model).State = EntityState.Modified;

                db.SaveChanges();

                return(model);
            }
        }
Пример #9
0
        public T Atualizar(T modelo)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.ChangeTracker.AutoDetectChangesEnabled = false;

                db.Entry(modelo).State = EntityState.Modified;

                db.SaveChanges();

                return(modelo);
            }
        }
Пример #10
0
        public T Inserir(T modelo)
        {
            using (var db = new SistemaDeEventosContext())
            {
                db.ChangeTracker.AutoDetectChangesEnabled = false;

                db.Set <T>().Add(modelo);

                db.SaveChanges();

                return(modelo);
            }
        }