Stardust.Paradox.Data.Providers.Gremlin
1.3.0
.NET Standard 2.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Stardust.Paradox.Data.Providers.Gremlin --version 1.3.0
NuGet\Install-Package Stardust.Paradox.Data.Providers.Gremlin -Version 1.3.0
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="Stardust.Paradox.Data.Providers.Gremlin" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Stardust.Paradox.Data.Providers.Gremlin --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Stardust.Paradox.Data.Providers.Gremlin, 1.3.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Stardust.Paradox.Data.Providers.Gremlin as a Cake Addin
#addin nuget:?package=Stardust.Paradox.Data.Providers.Gremlin&version=1.3.0
// Install Stardust.Paradox.Data.Providers.Gremlin as a Cake Tool
#tool nuget:?package=Stardust.Paradox.Data.Providers.Gremlin&version=1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Usage (asp.net core)
Startup.cs
ConfigureServices
Add the generated entity implementations to the IOC container (I will provide an extention method to make this easier)
services.AddEntityBinding((entityType, entityImplementation) => services.AddTransient(entityType, entityImplementation))
.AddScoped<MyEntityContext,MyEntityContext>()
.AddScoped<IGremlinLanguageConnector>(s => new CosmosDbLanguageConnector(DbAccountName, AccessKey, "databaseName","collectionName"));
Defining the model
[VertexLabel("person")]
public interface IPerson : IVertex
{
string Id {get;}
string FirstName { get; set; }
string LastName { get; set; }
string Email { get; set; }
IEdgeCollection<IPerson> Parents { get; }
IEdgeCollection<IPerson> Children { get; }
IEdgeCollection<IPerson> Siblings { get; }
[EdgeLabel("city")] //pointing to the Residents property in ICity
IEdgeReference<ICity> HomeCity { get; }//use IEdgeReference to enable task-async operations
IEdgeCollection<ICompany> Employers { get; }
}
[VertexLabel("city")]
public interface ICity : IVertex
{
string Id { get; }
string Name { get; set; }
string ZipCode { get; set; }
[ReverseEdgeLabel("city")] //pointing to the HomCity property in IPerson
IEdgeCollection<Iperson> Residents { get; } //use IEdgeCollection to enable task-async operations on the collection
IEdgeReference<ICountry> Country { get; }
}
[VertexLabel("company")]
public interface ICompany : IVertex
{
string Id { get; }
string Name { get; set; }
IEdgeCollection<ICompany> Employees { get; }
}
[VertexLabel("country")]
public interface ICountry : IVertex
{
string Id { get; }
string Name { get; set; }
string CountryCode { get; set; }
string PhoneNoPrefix { get; set; }
IEdgeCollection<ICity> Cities { get; }
}
Defining the entity context and generating the entity implementations
public class MyEntityContext : Stardust.Paradox.Data.GraphContextBase
{
public IGraphSet<IPerson> Persons => GraphSet<IPerson>();
public IGraphSet<ICity> Cities => GraphSet<ICity>();
public IGraphSet<ICountry> Countries => GraphSet<ICountry>();
public IGraphSet<ICompany> Companies => GraphSet<ICompany>();
public MyEntityContext(IGremlinLanguageConnector connector, IServiceProvider resolver) : base(connector, resolver)
{
}
protected override bool InitializeModel(IGraphConfiguration configuration)
{
//Added some fluent configuration of the edges
configuration.ConfigureCollection<IPerson>()
.AddEdge(t => t.Children, "children").Reverse<IPerson>(t => t.Parents)
.ConfigureCollection<ICity>()
.ConfigureCollection<ICountry>()
.AddEdge(t=>t.Cities).Reverse<ICountry>(t=>t.Country)
.ConfigureCollection<ICompany>()
.AddEdge(t => t.Employees, "employees").Reverse<IPerson>(t => t.Employers);
return true;
}
}
Product | Versions |
---|---|
.NET | net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows |
.NET Core | netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1 |
.NET Standard | netstandard2.0 netstandard2.1 |
.NET Framework | net461 net462 net463 net47 net471 net472 net48 net481 |
MonoAndroid | monoandroid |
MonoMac | monomac |
MonoTouch | monotouch |
Tizen | tizen40 tizen60 |
Xamarin.iOS | xamarinios |
Xamarin.Mac | xamarinmac |
Xamarin.TVOS | xamarintvos |
Xamarin.WatchOS | xamarinwatchos |
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Gremlin.Net (>= 3.3.3)
- Stardust.Paradox.Data (>= 1.3.0)
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 |
---|---|---|
3.0.0-rc01 | 379 | 2/14/2020 |
2.3.3 | 826 | 4/12/2021 |
2.3.1 | 2,925 | 1/13/2020 |
2.3.0 | 542 | 12/2/2019 |
2.2.0 | 417 | 11/12/2019 |
2.1.2 | 1,417 | 4/2/2019 |
2.1.1 | 445 | 4/2/2019 |
2.1.0 | 428 | 4/2/2019 |
2.0.5 | 434 | 4/1/2019 |
2.0.4 | 456 | 3/27/2019 |
2.0.3 | 444 | 3/27/2019 |
2.0.2 | 449 | 3/6/2019 |
2.0.1 | 439 | 2/26/2019 |
2.0.0 | 527 | 2/20/2019 |
2.0.0-pre06 | 419 | 2/14/2019 |
2.0.0-pre05 | 403 | 2/13/2019 |
2.0.0-pre04 | 422 | 2/11/2019 |
2.0.0-pre03 | 425 | 2/11/2019 |
2.0.0-pre02 | 435 | 2/11/2019 |
2.0.0-pre01 | 420 | 2/5/2019 |
1.4.2 | 631 | 11/28/2018 |
1.4.1 | 606 | 11/6/2018 |
1.3.0 | 778 | 8/23/2018 |
1.0.1 | 781 | 8/15/2018 |
1.0.0 | 758 | 8/15/2018 |