public ConditionMatchResult MatchesCondition(ConditionMatchResult result, ContextHolder context)
        {
            var c = context.ApplicationLookupContext;

            if (c == null)
            {
                c = new ApplicationLookupContext();
            }
            return(result.AppendMetadataMatch(MetadataId, c.MetadataId).Append(
                       con.Calculate(Schema, c.Schema)).Append(
                       con.Calculate(Mode, c.Mode)).Append(
                       con.Calculate(ParentApplication, c.ParentApplication)).Append(
                       con.Calculate(ParentSchema, c.ParentSchema)).Append(
                       con.Calculate(ParentMode, c.ParentMode)).Append(
                       con.Calculate(AttributeName, c.AttributeName)));
        }
示例#2
0
        protected bool Equals(ContextHolder other)
        {
            var baseEqual = string.Equals(OrgId, other.OrgId) &&
                            string.Equals(SiteId, other.SiteId) &&
                            string.Equals(Mode, other.Mode) && string.Equals(Platform, other.Platform) &&
                            string.Equals(Environment, other.Environment) &&
                            string.Equals(User, other.User) &&
                            string.Equals(Module, other.Module);

            if (!baseEqual)
            {
                return(false);
            }
            var profileEqual    = (UserProfiles == null || !UserProfiles.Any()) ? (other.UserProfiles == null || !other.UserProfiles.Any()) : (other.UserProfiles != null && UserProfiles.SequenceEqual(other.UserProfiles));
            var appContextEqual = ApplicationLookupContext == null ? other.ApplicationLookupContext == null :
                                  ApplicationLookupContext.Equals(other.ApplicationLookupContext);

            return(profileEqual && appContextEqual);
        }