Gremlin.Linq 1.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Gremlin.Linq --version 1.0.2
NuGet\Install-Package Gremlin.Linq -Version 1.0.2
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="Gremlin.Linq" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Gremlin.Linq --version 1.0.2
#r "nuget: Gremlin.Linq, 1.0.2"
#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 Gremlin.Linq as a Cake Addin
#addin nuget:?package=Gremlin.Linq&version=1.0.2

// Install Gremlin.Linq as a Cake Tool
#tool nuget:?package=Gremlin.Linq&version=1.0.2

Project source can be found at - https://github.com/crosscutsolutions/gremlin.linq

Gremlin.Linq is a library that enables you to write fluent queries using lambda expressions.

Adding entities

When you add entities you can either work with pure POCO's or use classes that derives from the Vertex class.

Connecting to the server is done by adding properties to your configuration, preferably using appsettings.json.

var config =  new  ConfigurationBuilder()
	.AddJsonFile("appsettings.json", false)
	.AddJsonFile("appsettings.development.json", true)
	.Build();

using (var client =  new  GraphClientFactory(config).CreateGremlinGraphClient())
{
// Use your client to update or query the graph here
}

Your appsettings.json should then look like this.

{
  "gremlin": {
    "url": "yourdb.azure.com",
    "database": "<databaseName>",
    "collection": "<collectionName>"
  }
}

Adding entities at it's simplest

var user = client
	.Add(new User(){})
	.SubmitAsync();

You can also add two entities and connect them. In the example below a vertex of type User will be created joined to a vertex of type login with the edge property set to "GoogleLogin"

var login = client
	.Add(new User())
	.AddOut(new Login(),"GoogleLogin")
	.ExecuteAsync();

##Querying graph

To query the graph you can use lambda expressions. In the example below we will find users with firstname John

var users = client
	.From<User>()
	.Where(user=>user.FirstName=="John")
	.SubmitAsync();

To select connected vertexes

var logins = client
    .From<User>()
    .WhereIn(a => a.FirstName, new string[] {"test1", "test2"})
	.Out<Login>()
	.SubmitAsync();

To find connected vertexes the other way around

var user = client
	.From<Login>()
	.Where(login=>login.Provider=="Google")
	.In<User>()
	.SubmitWithSingleResultAsync();
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 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.4.0-unstable0010 728 9/3/2018
1.4.0-unstable0006 670 9/3/2018
1.4.0-unstable0004 827 6/12/2018
1.4.0-unstable0001 789 6/12/2018
1.3.2 5,547 3/22/2019
1.3.1 1,371 6/12/2018
1.3.0 974 6/12/2018
1.2.0-unstable0009 797 6/12/2018
1.2.0-unstable0007 864 5/29/2018
1.2.0-unstable0006 844 5/14/2018
1.2.0-unstable0005 815 5/10/2018
1.2.0-unstable0002 812 5/9/2018
1.1.2 1,006 5/10/2018
1.1.1 997 5/10/2018
1.1.0-unstable0003 880 5/1/2018
1.1.0-unstable0002 852 4/29/2018
1.0.2 975 4/29/2018
1.0.1 1,086 4/28/2018
1.0.0 887 4/27/2018