public void RemoveByRoleId(int id)
        {
            var rolePrivileges = db.Set <RolePrivilege>().Where(x => x.RoleId == id);

            db.Set <RolePrivilege>().RemoveRange(rolePrivileges);
            db.SaveChanges();
        }
예제 #2
0
        public void RemoveByUserId(int id)
        {
            var userRoles = db.Set <UserRole>().Where(x => x.UserId == id);

            db.Set <UserRole>().RemoveRange(userRoles);
            db.SaveChanges();
        }
예제 #3
0
 public void Remove(RemovableTable removableTable)
 {
     db.Set <RemovableTable>().Remove(removableTable);
     db.SaveChanges();
 }
예제 #4
0
 public void ChangePassword(User user)
 {
     db.Set <User>().Attach(user);
     db.Entry(user).Property(x => x.Password).IsModified = true;
     db.SaveChanges();
 }
예제 #5
0
 public void Update(UpdatableTable updatableTable)
 {
     db.Set <UpdatableTable>().Update(updatableTable);
     db.SaveChanges();
 }
예제 #6
0
 public void Add(CreatableTable creatableTable)
 {
     db.Set <CreatableTable>().Add(creatableTable);
     db.SaveChanges();
 }
예제 #7
0
 public void AddRange(List <MultipleAddableTable> multipleAddableTables)
 {
     db.Set <MultipleAddableTable>().AddRange(multipleAddableTables);
     db.SaveChanges();
 }
 public void RemoveAll(List <MultipleRemovableTable> multipleRemovableTables)
 {
     db.Set <MultipleRemovableTable>().RemoveRange(multipleRemovableTables);
     db.SaveChanges();
 }