private void SyncRoles(IList<RoleCheckBox> checkBoxes, IList<Role> roles) { var selectedRoles = new List<Role>(); foreach (var role in Database.Session.Query<Role>()) { var checkbox = checkBoxes.Single(a => a.Id == role.Id); checkbox.Name = role.Name; if(checkbox.IsChecked) selectedRoles.Add(role); } foreach (var toAdd in selectedRoles.Where(a => !roles.Contains(a))) roles.Add(toAdd); foreach (var toRemove in roles.Where(a => !selectedRoles.Contains(a)).ToList()) roles.Remove(toRemove); }
public virtual bool IsClassOrSuperclassJoin(Join join) { return(joins.Contains(join)); }