} // AddStaffMember public IList<StaffMember> UpdateStaffMember(Guid orgId, StaffMember staff) { var pod = POD(orgId); if (pod.Staff == null) throw new Exception("Organisation has no staff"); var currentStaff = pod.Staff.Find(s => s.Id == staff.Id); if (currentStaff == null) throw new Exception("Staff member does not belong to the organisation"); currentStaff.CopyFrom(staff.staffData()); Commit(currentStaff); using (var authRepo = new AuthRepository()) { authRepo.SetUserRoles(currentStaff.UserName, staff.Roles); } // using ... return FetchStaffMembers(orgId); } // UpdateStaffMember