CypherQueryBuilder 1.4.2
See the version list below for details.
dotnet add package CypherQueryBuilder --version 1.4.2
NuGet\Install-Package CypherQueryBuilder -Version 1.4.2
<PackageReference Include="CypherQueryBuilder" Version="1.4.2" />
paket add CypherQueryBuilder --version 1.4.2
#r "nuget: CypherQueryBuilder, 1.4.2"
// Install CypherQueryBuilder as a Cake Addin #addin nuget:?package=CypherQueryBuilder&version=1.4.2 // Install CypherQueryBuilder as a Cake Tool #tool nuget:?package=CypherQueryBuilder&version=1.4.2
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>
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>
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
See Also
<a name='CypherQueryBuilder.MatchCreationQuery.CompileWithParemeters()'></a>
MatchCreationQuery.CompileWithParemeters() Method
Compiles the instance to Cypher Query string with paremeters.
public override ValueTuple<string,Dictionary<string,object?>> CompileWithParemeters();
Returns
System.ValueTuple
ValueTuple<string, Dictionary<string, Nullable<Object>>>
Example
Usage:
var metaDataCount = 2;
var metaDataNodes = new Node<MetaData>[metaDataCount];
for (int i = 0; i < metaDataCount; i++)
{
var id = $"mId_{i}";
metaDataNodes[i] = Node<MetaData>.Instance(i).Where(p => p.Uid == id);
}
var domainNode = Node<Domain>.Instance().Where(p => p.Uid == "TestDomain");
var (mq, parameters) = Query.Match(domainNode, metaDataNodes).CompileAsParemeterized();
See Also
<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
See Also
<a name='CypherQueryBuilder.MatchQuery.CompileWithParemeters()'></a>
MatchQuery.CompileWithParemeters() Method
Compiles the instance to Cypher Query string with paremeters.
public virtual ValueTuple<string,Dictionary<string,object?>> CompileWithParemeters();
Returns
System.ValueTuple
ValueTuple<string, Dictionary<string, Nullable<Object>>>
Example
Usage:
var metaDataCount = 2;
var metaDataNodes = new Node<MetaData>[metaDataCount];
for (int i = 0; i < metaDataCount; i++)
{
var id = $"mId_{i}";
metaDataNodes[i] = Node<MetaData>.Instance(i).Where(p => p.Uid == id);
}
var domainNode = Node<Domain>.Instance().Where(p => p.Uid == "TestDomain");
var (mq, parameters) = Query.Match(domainNode, metaDataNodes).CompileAsParemeterized();
See Also
<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.
<a name='CypherQueryBuilder.MatchQuery.CreateRelation(string,string,CypherQueryBuilder.Node,CypherQueryBuilder.Node,bool,object).to'></a>
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
<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
<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
<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
<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
<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
<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
<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
<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
<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>
The node.
<a name='CypherQueryBuilder.Query.Create(bool,CypherQueryBuilder.Node,CypherQueryBuilder.Node[]).otherNodes'></a>
otherNodes
CypherQueryBuilder.Node[]
The other nodes.
Returns
CypherQueryBuilder.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 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
CypherQueryBuilder.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 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>
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
CypherQueryBuilder.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
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 | Versions 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. |
-
net8.0
- Currying (>= 1.0.4)
- ExpressionTreeToStringWithCypher (>= 1.1.0)
- Microsoft.IdentityModel.Tokens (>= 7.6.3)
- Utility.Disposable (>= 1.1.1)
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 | 82 | 11/11/2024 | |
1.7.3 | 76 | 11/5/2024 | |
1.7.2 | 68 | 10/29/2024 | |
1.7.1 | 106 | 9/25/2024 | |
1.7.0 | 92 | 9/24/2024 | |
1.6.2 | 106 | 9/11/2024 | |
1.6.1 | 81 | 8/2/2024 | |
1.6.0 | 59 | 7/31/2024 | |
1.5.2 | 71 | 7/26/2024 | |
1.5.1 | 100 | 7/24/2024 | |
1.5.0 | 97 | 7/15/2024 | |
1.4.2 | 87 | 7/12/2024 | |
1.4.1 | 91 | 7/12/2024 | |
1.4.0 | 79 | 7/12/2024 | |
1.3.2 | 110 | 7/9/2024 | |
1.3.1 | 96 | 7/5/2024 | |
1.3.0 | 97 | 7/5/2024 | |
1.2.0 | 107 | 7/2/2024 | |
1.1.1 | 105 | 7/1/2024 | |
1.1.0 | 106 | 6/29/2024 | |
1.0.0 | 127 | 6/25/2024 |