Esempio n. 1
0
        public void Edit(int Id)
        {
            SomethingEntities ctx = new SomethingEntities();
            Users             usr = ctx.Set <Users>().Where(c => c.Id == Id).FirstOrDefault();

            ctx.Set <Users>().Remove(usr);
            ctx.SaveChanges();
        }
Esempio n. 2
0
        public List <Users> List()
        {
            List <Users>      liste = new List <Users>();
            SomethingEntities ctx   = new SomethingEntities();

            liste = ctx.Set <Users>().ToList();
            return(liste);
        }
Esempio n. 3
0
        public Users List(int id)
        {
            Users             user = new Users();
            SomethingEntities ctx  = new SomethingEntities();

            user = ctx.Set <Users>().Where(c => c.Id == id).FirstOrDefault();
            return(user);
        }
Esempio n. 4
0
        public void Add(Users entity)
        {
            SomethingEntities ctx = new SomethingEntities();

            entity.IsDeleted = false;
            ctx.Set <Users>().Add(entity);
            ctx.SaveChanges();
        }