CypherQueryBuilder 1.4.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package CypherQueryBuilder --version 1.4.1                
NuGet\Install-Package CypherQueryBuilder -Version 1.4.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CypherQueryBuilder" Version="1.4.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CypherQueryBuilder --version 1.4.1                
#r "nuget: CypherQueryBuilder, 1.4.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install CypherQueryBuilder as a Cake Addin
#addin nuget:?package=CypherQueryBuilder&version=1.4.1

// Install CypherQueryBuilder as a Cake Tool
#tool nuget:?package=CypherQueryBuilder&version=1.4.1                
CypherQueryBuilder

CypherQueryBuilder Assembly

Namespaces

<a name='CypherQueryBuilder'></a>

CypherQueryBuilder Namespace

Classes

<a name='CypherQueryBuilder.DeleteQuery'></a>

DeleteQuery Class

public class DeleteQuery : CypherQueryBuilder.MatchQuery

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

Methods

<a name='CypherQueryBuilder.DeleteQuery.Compile()'></a>

DeleteQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();
Returns

System.String
Cypher Query string

<a name='CypherQueryBuilder.DeleteQuery.Delete_T_(T[])'></a>

DeleteQuery.Delete<T>(T[]) Method

Deletes the specified entities.

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

<a name='CypherQueryBuilder.DeleteQuery.Delete_T_(T[]).T'></a>

T

Parameters

<a name='CypherQueryBuilder.DeleteQuery.Delete_T_(T[]).entities'></a>

entities T[]

The entities to delete.

Returns

DeleteQuery
DeleteQuery

<a name='CypherQueryBuilder.DeleteQuery.Detach_T_(T[])'></a>

DeleteQuery.Detach<T>(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

<a name='CypherQueryBuilder.DeleteQuery.Detach_T_(T[]).T'></a>

T

Parameters

<a name='CypherQueryBuilder.DeleteQuery.Detach_T_(T[]).entities'></a>

entities T[]

The entities to detache and delete.

Returns

DeleteQuery
DeleteQuery

<a name='CypherQueryBuilder.DeleteQuery.ReleaseResources()'></a>

DeleteQuery.ReleaseResources() Method

Releases the resources, used while disposing.

public override void ReleaseResources();

<a name='CypherQueryBuilder.MatchCreationQuery'></a>

MatchCreationQuery Class

public class MatchCreationQuery : CypherQueryBuilder.MatchQuery

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

Methods

<a name='CypherQueryBuilder.MatchCreationQuery.Compile()'></a>

MatchCreationQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();
Returns

System.String
Cypher Query string

<a name='CypherQueryBuilder.MatchQuery'></a>

MatchQuery Class

public class MatchQuery : CypherQueryBuilder.QueryBase

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

Derived
↳ DeleteQuery
↳ MatchCreationQuery

Methods

<a name='CypherQueryBuilder.MatchQuery.Compile()'></a>

MatchQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();
Returns

System.String
Cypher Query string

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object)'></a>

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

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).alias'></a>

alias System.String

The alias.

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).label'></a>

label System.String

The label.

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).from'></a>

from CypherQueryBuilder.Node

From.

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).to'></a>

to CypherQueryBuilder.Node

To.

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).toMerge'></a>

toMerge System.Boolean

if set to true [to merge].

<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).properties'></a>

properties System.Object

The properties.

Returns

MatchCreationQuery

<a name='CypherQueryBuilder.MatchQuery.Limit(int)'></a>

MatchQuery.Limit(int) Method

Limits the specified limit.

public CypherQueryBuilder.MatchQuery Limit(int limit);
Parameters

<a name='CypherQueryBuilder.MatchQuery.Limit(int).limit'></a>

limit System.Int32

The limit.

Returns

MatchQuery
MatchQuery

<a name='CypherQueryBuilder.MatchQuery.OrWhere(string)'></a>

MatchQuery.OrWhere(string) Method

Ors the where.

public CypherQueryBuilder.MatchQuery OrWhere(string clause);
Parameters

<a name='CypherQueryBuilder.MatchQuery.OrWhere(string).clause'></a>

clause System.String

The clause.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Return(string[])'></a>

MatchQuery.Return(string[]) Method

Returns the specified returns.

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

<a name='CypherQueryBuilder.MatchQuery.Return(string[]).returns'></a>

returns System.String[]

The returns.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Return_T_(CypherQueryBuilder.Node_T_,Expression_Func_T,object__)'></a>

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

Returns the specified node.

public virtual CypherQueryBuilder.MatchQuery Return<T>(CypherQueryBuilder.Node<T> node, Expression<Func<T,object>> f);
Type parameters

<a name='CypherQueryBuilder.MatchQuery.Return_T_(CypherQueryBuilder.Node_T_,Expression_Func_T,object__).T'></a>

T

Parameters

<a name='CypherQueryBuilder.MatchQuery.Return_T_(CypherQueryBuilder.Node_T_,Expression_Func_T,object__).node'></a>

node CypherQueryBuilder.Node<T>

The node.

<a name='CypherQueryBuilder.MatchQuery.Return_T_(CypherQueryBuilder.Node_T_,Expression_Func_T,object__).f'></a>

f System.Linq.Expressions.Expression

The f.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Return_T_(Expression_Func_T,object__)'></a>

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

Returns the specified f.

public CypherQueryBuilder.MatchQuery Return<T>(Expression<Func<T,object>>? f=null);
Type parameters

<a name='CypherQueryBuilder.MatchQuery.Return_T_(Expression_Func_T,object__).T'></a>

T

Parameters

<a name='CypherQueryBuilder.MatchQuery.Return_T_(Expression_Func_T,object__).f'></a>

f System.Linq.Expressions.Expression

The f.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Return_T_(string,Expression_Func_T,object__)'></a>

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

Returns the specified alias.

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

<a name='CypherQueryBuilder.MatchQuery.Return_T_(string,Expression_Func_T,object__).T'></a>

T

Parameters

<a name='CypherQueryBuilder.MatchQuery.Return_T_(string,Expression_Func_T,object__).alias'></a>

alias System.String

The alias.

<a name='CypherQueryBuilder.MatchQuery.Return_T_(string,Expression_Func_T,object__).f'></a>

f System.Linq.Expressions.Expression

The f.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Skip(int)'></a>

MatchQuery.Skip(int) Method

Skips the specified skip.

public CypherQueryBuilder.MatchQuery Skip(int skip);
Parameters

<a name='CypherQueryBuilder.MatchQuery.Skip(int).skip'></a>

skip System.Int32

The skip.

Returns

MatchQuery

<a name='CypherQueryBuilder.MatchQuery.Union(CypherQueryBuilder.MatchQuery)'></a>

MatchQuery.Union(MatchQuery) Method

Unions the specified other.

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

<a name='CypherQueryBuilder.MatchQuery.Union(CypherQueryBuilder.MatchQuery).other'></a>

other MatchQuery

The other.

Returns

CypherQueryBuilder.UnionQuery

<a name='CypherQueryBuilder.MatchQuery.Where(string)'></a>

MatchQuery.Where(string) Method

Wheres the specified clause.

public CypherQueryBuilder.MatchQuery Where(string clause);
Parameters

<a name='CypherQueryBuilder.MatchQuery.Where(string).clause'></a>

clause System.String

The clause.

Returns

MatchQuery

<a name='CypherQueryBuilder.NodeCreationQuery'></a>

NodeCreationQuery Class

public class NodeCreationQuery : CypherQueryBuilder.QueryBase

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

Methods

<a name='CypherQueryBuilder.NodeCreationQuery.Compile()'></a>

NodeCreationQuery.Compile() Method

Compiles this instance to Cypher Query string.

public override string Compile();
Returns

System.String
Cypher Query string

<a name='CypherQueryBuilder.Query'></a>

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

<a name='CypherQueryBuilder.Query.Create(bool,CypherQueryBuilder.Node,CypherQueryBuilder.Node[])'></a>

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

<a name='CypherQueryBuilder.Query.Create(bool,CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).toMerge'></a>

toMerge System.Boolean

if set to true [to merge].

<a name='CypherQueryBuilder.Query.Create(bool,CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).node'></a>

node CypherQueryBuilder.Node

The node.

<a name='CypherQueryBuilder.Query.Create(bool,CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).otherNodes'></a>

otherNodes CypherQueryBuilder.Node[]

The other nodes.

Returns

NodeCreationQuery

<a name='CypherQueryBuilder.Query.Create(CypherQueryBuilder.Node,CypherQueryBuilder.Node[])'></a>

Query.Create(Node, Node[]) Method

Creates the specified node.

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

<a name='CypherQueryBuilder.Query.Create(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).node'></a>

node CypherQueryBuilder.Node

Node to Instance

<a name='CypherQueryBuilder.Query.Create(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).otherNodes'></a>

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.Instance(  
                Node<Movie>.Instance(movie)  
                    .WithRelation(Node<Person>.Instance(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();  

<a name='CypherQueryBuilder.Query.Match(CypherQueryBuilder.Node,CypherQueryBuilder.Node[])'></a>

Query.Match(Node, Node[]) Method

Matches the specified node.

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

<a name='CypherQueryBuilder.Query.Match(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).node'></a>

node CypherQueryBuilder.Node

Node to Match

<a name='CypherQueryBuilder.Query.Match(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).otherNodes'></a>

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");  

<a name='CypherQueryBuilder.Query.Merge(CypherQueryBuilder.Node,CypherQueryBuilder.Node[])'></a>

Query.Merge(Node, Node[]) Method

Merges the specified node.

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

<a name='CypherQueryBuilder.Query.Merge(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).node'></a>

node CypherQueryBuilder.Node

The node.

<a name='CypherQueryBuilder.Query.Merge(CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).otherNodes'></a>

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>.Instance(movie)  
                    .WithRelation(Node<Person>.Instance(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();  

<a name='CypherQueryBuilder.QueryBase'></a>

QueryBase Class

public abstract class QueryBase : Utility.Disposable

Inheritance System.Object 🡒 Utility.Disposable 🡒 QueryBase

Derived
↳ MatchQuery
↳ NodeCreationQuery

Methods

<a name='CypherQueryBuilder.QueryBase.Compile()'></a>

QueryBase.Compile() Method

Compiles this instance to Cypher Query string.

public abstract string Compile();
Returns

System.String
Cypher Query string

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.7.4 93 11/11/2024
1.7.3 83 11/5/2024
1.7.2 73 10/29/2024
1.7.1 111 9/25/2024 1.7.1 is deprecated because it has critical bugs.
1.7.0 95 9/24/2024
1.6.2 109 9/11/2024
1.6.1 84 8/2/2024
1.6.0 62 7/31/2024
1.5.2 74 7/26/2024
1.5.1 103 7/24/2024
1.5.0 100 7/15/2024
1.4.2 90 7/12/2024
1.4.1 94 7/12/2024
1.4.0 82 7/12/2024
1.3.2 113 7/9/2024
1.3.1 99 7/5/2024
1.3.0 100 7/5/2024
1.2.0 110 7/2/2024
1.1.1 108 7/1/2024
1.1.0 109 6/29/2024
1.0.0 130 6/25/2024