Exemplo 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();
        }
Exemplo n.º 2
0
        public List <Users> List()
        {
            List <Users>      liste = new List <Users>();
            SomethingEntities ctx   = new SomethingEntities();

            liste = ctx.Set <Users>().ToList();
            return(liste);
        }
Exemplo 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);
        }
Exemplo n.º 4
0
        public void Add(Users entity)
        {
            SomethingEntities ctx = new SomethingEntities();

            entity.IsDeleted = false;
            ctx.Set <Users>().Add(entity);
            ctx.SaveChanges();
        }
Exemplo n.º 5
0
 public UserRepository()
 {
     ctx = new SomethingEntities();
     usr = new User();
 }