Пример #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();
        }
Пример #2
0
        public List <Users> List()
        {
            List <Users>      liste = new List <Users>();
            SomethingEntities ctx   = new SomethingEntities();

            liste = ctx.Set <Users>().ToList();
            return(liste);
        }
Пример #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);
        }
Пример #4
0
        public void Add(Users entity)
        {
            SomethingEntities ctx = new SomethingEntities();

            entity.IsDeleted = false;
            ctx.Set <Users>().Add(entity);
            ctx.SaveChanges();
        }
Пример #5
0
 public UserRepository()
 {
     ctx = new SomethingEntities();
     usr = new User();
 }