コード例 #1
0
        public static ICypherFluentQuery MatchRelationship <T>(this ICypherFluentQuery query, T relationship, List <CypherProperty> matchOverride = null) where T : BaseRelationship
        {
            var options = new MatchRelationshipOptions();

            options.MatchOverride = matchOverride;
            return(MatchRelationship(query, relationship, options));
        }
コード例 #2
0
 public static ICypherFluentQuery MatchRelationship <T>(
     this ICypherFluentQuery query
     , T relationship
     , MatchRelationshipOptions options) where T : BaseRelationship
 {
     return(MatchRelationshipWorker(query, relationship, options, (fluentQuery, s) => fluentQuery.Match(s)));
 }
コード例 #3
0
 public static ICypherFluentQuery OptionalMatchRelationship <T>(
     this ICypherFluentQuery query
     , T relationship
     , MatchRelationshipOptions options = null) where T : BaseRelationship
 {
     if (options == null)
     {
         options = new MatchRelationshipOptions();
     }
     return(MatchRelationshipWorker(query, relationship, options, (fluentQuery, s) => fluentQuery.OptionalMatch(s)));
 }
コード例 #4
0
        private static ICypherFluentQuery MatchRelationshipWorker <T>(
            this ICypherFluentQuery query
            , T relationship
            , MatchRelationshipOptions options
            , Func <ICypherFluentQuery, string, ICypherFluentQuery> matchFunction) where T : BaseRelationship
        {
            var matchProperties = options.MatchOverride ?? CypherTypeItemHelper.PropertiesForPurpose <T, CypherMatchAttribute>(relationship);
            var cql             = GetRelationshipCql(
                relationship.FromKey
                , relationship.ToCypherString <T, CypherMatchAttribute>(CypherExtensionContext.Create(query), relationship.Key, matchProperties)
                , relationship.ToKey);

            return(matchFunction(query, cql));
        }
コード例 #5
0
 public static MatchRelationshipOptions WithNoProperties(this MatchRelationshipOptions target)
 {
     return(WithProperties(target, new List <CypherProperty>()));
 }
コード例 #6
0
 public static MatchRelationshipOptions WithProperties(this MatchRelationshipOptions target, List <CypherProperty> propertyOverride)
 {
     target.MatchOverride = propertyOverride;
     return(target);
 }