public override bool Equals(object obj) { CompetitionModel other = obj as CompetitionModel; if (other == null) { return(false); } return(this.Iid.Equals(other.Iid)); }
public static bool IsInRoleComp(this UserProfileModel user, RoleEnum role, CompetitionModel comp) { if (user == null || comp == null) { return(false); } if (IsInRole(user, (u => u.RoleId >= (int)role && u.CompID == comp.Iid))) { return(true); } if (((int)role) >= ((int)RoleEnum.Admin)) { return(IsInRole(user, u => (u.RoleId >= (int)role) && u.CompID == null && (u.RegionID == null && comp.Region.IidParent == null || u.RegionID != null && comp.Region.IidParent != null && comp.Region.IidParent == u.RegionID))); } return(false); }