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(); }
public List <Users> List() { List <Users> liste = new List <Users>(); SomethingEntities ctx = new SomethingEntities(); liste = ctx.Set <Users>().ToList(); return(liste); }
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); }
public void Add(Users entity) { SomethingEntities ctx = new SomethingEntities(); entity.IsDeleted = false; ctx.Set <Users>().Add(entity); ctx.SaveChanges(); }
public UserRepository() { ctx = new SomethingEntities(); usr = new User(); }