Skip to content

techJmage/CypherQueryBuilder

Repository files navigation

CypherQueryBuilder Assembly

Namespaces

CypherQueryBuilder Namespace

Classes

DeleteQuery Class

public class DeleteQuery : CypherQueryBuilder.MatchQuery

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase 🡒 MatchQuery 🡒 DeleteQuery

Methods

DeleteQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();

Returns

System.String
Cypher Query string

DeleteQuery.Delete(T[]) Method

Deletes the specified entities.

public override CypherQueryBuilder.DeleteQuery Delete<T>(params T[] entities)
    where T : CypherQueryBuilder.Entity;

Type parameters

T

Parameters

entities T[]

The entities to delete.

Returns

DeleteQuery
DeleteQuery

DeleteQuery.Detach(T[]) Method

Detaches, i.e. delete with all the associated relations (if it is a node), the specified entities.

public override CypherQueryBuilder.DeleteQuery Detach<T>(params T[] entities)
    where T : CypherQueryBuilder.Entity;

Type parameters

T

Parameters

entities T[]

The entities to detache and delete.

Returns

DeleteQuery
DeleteQuery

DeleteQuery.ReleaseResources() Method

Releases the resources, used while disposing.

public override void ReleaseResources();

MatchCreationQuery Class

public class MatchCreationQuery : CypherQueryBuilder.MatchQuery

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase 🡒 MatchQuery 🡒 MatchCreationQuery

Methods

MatchCreationQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();

Returns

System.String
Cypher Query string

MatchQuery Class

public class MatchQuery : CypherQueryBuilder.QueryBase

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase 🡒 MatchQuery

Derived
DeleteQuery
MatchCreationQuery

Methods

MatchQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();

Returns

System.String
Cypher Query string

MatchQuery.CreateRelation(string, string, Node, Node, bool, object) Method

Creates the relation.

public virtual CypherQueryBuilder.MatchCreationQuery CreateRelation(string alias, string label, CypherQueryBuilder.Node from, CypherQueryBuilder.Node to, bool toMerge=false, object? properties=null);

Parameters

alias System.String

The alias.

label System.String

The label.

from CypherQueryBuilder.Node

From.

to CypherQueryBuilder.Node

To.

toMerge System.Boolean

if set to true [to merge].

properties System.Object

The properties.

Returns

MatchCreationQuery

MatchQuery.Limit(int) Method

Limits the specified limit.

public CypherQueryBuilder.MatchQuery Limit(int limit);

Parameters

limit System.Int32

The limit.

Returns

MatchQuery
MatchQuery

MatchQuery.OrWhere(string) Method

Ors the where.

public CypherQueryBuilder.MatchQuery OrWhere(string clause);

Parameters

clause System.String

The clause.

Returns

MatchQuery

MatchQuery.Return(string[]) Method

Returns the specified returns.

public virtual CypherQueryBuilder.MatchQuery Return(params string[] returns);

Parameters

returns System.String[]

The returns.

Returns

MatchQuery

MatchQuery.Return(Node, Expression<Func<T,object>>) Method

Returns the specified node.

public virtual CypherQueryBuilder.MatchQuery Return<T>(CypherQueryBuilder.Node<T> node, System.Linq.Expressions.Expression<System.Func<T,object>> f);

Type parameters

T

Parameters

node CypherQueryBuilder.Node<T>

The node.

f System.Linq.Expressions.Expression<System.Func<T,System.Object>>

The f.

Returns

MatchQuery

MatchQuery.Return(string, Expression<Func<T,object>>) Method

Returns the specified alias.

public virtual CypherQueryBuilder.MatchQuery Return<T>(string? alias, System.Linq.Expressions.Expression<System.Func<T,object>> f);

Type parameters

T

Parameters

alias System.String

The alias.

f System.Linq.Expressions.Expression<System.Func<T,System.Object>>

The f.

Returns

MatchQuery

MatchQuery.Return(Expression<Func<T,object>>) Method

Returns the specified f.

public CypherQueryBuilder.MatchQuery Return<T>(System.Linq.Expressions.Expression<System.Func<T,object>>? f=null);

Type parameters

T

Parameters

f System.Linq.Expressions.Expression<System.Func<T,System.Object>>

The f.

Returns

MatchQuery

MatchQuery.Skip(int) Method

Skips the specified skip.

public CypherQueryBuilder.MatchQuery Skip(int skip);

Parameters

skip System.Int32

The skip.

Returns

MatchQuery

MatchQuery.Union(MatchQuery) Method

Unions the specified other.

public CypherQueryBuilder.UnionQuery Union(CypherQueryBuilder.MatchQuery other);

Parameters

other MatchQuery

The other.

Returns

CypherQueryBuilder.UnionQuery

MatchQuery.Where(string) Method

Wheres the specified clause.

public CypherQueryBuilder.MatchQuery Where(string clause);

Parameters

clause System.String

The clause.

Returns

MatchQuery

NodeCreationQuery Class

public class NodeCreationQuery : CypherQueryBuilder.QueryBase

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase 🡒 NodeCreationQuery

Methods

NodeCreationQuery.Compile() Method

Compiles this instance to Cypher Query string.

public string Compile();

Returns

System.String
Cypher Query string

Query Class

Query - The main entry point to build cypher query for create, merge or match

public static class Query

Inheritance System.Object 🡒 Query

Methods

Query.Create(bool, Node, Node[]) Method

Creates the specified to merge.

private static CypherQueryBuilder.NodeCreationQuery Create(bool toMerge, CypherQueryBuilder.Node node, params CypherQueryBuilder.Node[] otherNodes);

Parameters

toMerge System.Boolean

if set to true [to merge].

node CypherQueryBuilder.Node

The node.

otherNodes CypherQueryBuilder.Node[]

The other nodes.

Returns

NodeCreationQuery

Query.Create(Node, Node[]) Method

Creates the specified node.

public static CypherQueryBuilder.NodeCreationQuery Create(CypherQueryBuilder.Node node, params CypherQueryBuilder.Node[] otherNodes);

Parameters

node CypherQueryBuilder.Node

Node to Create

otherNodes CypherQueryBuilder.Node[]

Other nodes to match in case multiple nodes to be created.

Returns

NodeCreationQuery
NodeCreationQuery

Example

Example to build create query.

var movie = new Movie() { ReleaseYear = 2010, Title = "Gambler" };  
            var q = Query.Create(  
                Node<Movie>.Create(movie)  
                    .WithRelation(Node<Person>.Create(new Person {Age = 30, FullName = "Ray" }), "DIRECTED_BY"))  
                .Return<Movie>(p => new { p.Title, p.ReleaseYear }).Return<Person>(p => new { p.FullName});  
            var str = q.Compile();  

Query.Match(Node, Node[]) Method

Matches the specified node.

public static CypherQueryBuilder.MatchQuery Match(CypherQueryBuilder.Node node, params CypherQueryBuilder.Node[] otherNodes);

Parameters

node CypherQueryBuilder.Node

Node to Match

otherNodes CypherQueryBuilder.Node[]

Other nodes to match in case multiple nodes to be matched

Returns

MatchQuery
MatchQuery

Example

var q = Query.Match(n).Return("n", "r", "m");  

Query.Merge(Node, Node[]) Method

Merges the specified node.

public static CypherQueryBuilder.NodeCreationQuery Merge(CypherQueryBuilder.Node node, params CypherQueryBuilder.Node[] otherNodes);

Parameters

node CypherQueryBuilder.Node

The node.

otherNodes CypherQueryBuilder.Node[]

The other nodes in case multiple nodes to be merged.

Returns

NodeCreationQuery
NodeCreationQuery

Example

Example to build merge query.

var movie = new Movie() { ReleaseYear = 2010, Title = "Gambler" };  
            var q = Query.Merge(  
                Node<Movie>.Create(movie)  
                    .WithRelation(Node<Person>.Create(new Person {Age = 30, FullName = "Ray" }), "DIRECTED_BY"))  
                .Return<Movie>(p => new { p.Title, p.ReleaseYear }).Return<Person>(p => new { p.FullName});  
            var str = q.Compile();  

QueryBase Class

public class QueryBase : Utility.Disposable

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase

Derived
MatchQuery
NodeCreationQuery

Methods

QueryBase.Compile() Method

Compiles this instance to Cypher Query string.

public virtual string Compile();

Returns

System.String
Cypher Query string

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages