{"__v":1,"_id":"57d6afdace63e60e0025b7c6","category":{"__v":0,"_id":"57d6ada046dcc30e007dd15e","project":"566c97797831040d003eb3bc","version":"566c97797831040d003eb3bf","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-09-12T13:29:04.136Z","from_sync":false,"order":8,"slug":"drivers-and-languages","title":"Language center"},"parentDoc":null,"project":"566c97797831040d003eb3bc","user":"5716283e40ef9c2000cac92a","version":{"__v":10,"_id":"566c97797831040d003eb3bf","project":"566c97797831040d003eb3bc","createdAt":"2015-12-12T21:54:01.970Z","releaseDate":"2015-12-12T21:54:01.970Z","categories":["566c977a7831040d003eb3c0","5716338cb5af590e00a0ff1d","57163947893cbe0e002d75fc","57163f41b5af590e00a0ff35","57cd74d2873de50e00724a2f","57cd7de8baaee30e0093ecc3","57d6ada046dcc30e007dd15e","57fdc2b31646dc0e0010480a","57fdd8b86c9d141900d87bf1","58767da4d89ef20f003b6f1e"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-09-12T13:38:34.801Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":6,"body":"If .NET is your language of choice, the most popular drivers are:\n\n* [Neo4j DotNet driver](#section-neo4j-bolt-driver-for-net) [official driver]\n* [Neo4jClient](#section-neo4jclient) [community driver]\n\nThese drivers are shipped exclusively as a NuGet package. To use them in your projects, you will need to use the [Package Manager Console](https://docs.nuget.org/ndocs/tools/package-manager-console).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We've used test credentials for all the following examples. Please replace them with your real connection parameters.\\n\\nYou'll find all the required information to connect to your database on our admin panel if you navigate to the Connection section. More on connecting to your database [here](doc:connecting-to-your-database)\",\n  \"title\": \"About connection parameters\"\n}\n[/block]\n## Neo4j Bolt driver for .NET\n\nThe Neo4j .NET driver is the one officially supported by Neo4j and connects to the database using Bolt protocol (HTTP/HTTPS not available).\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"**Bolt protocol is available in 3.0.0 or higher versions of Neo4j.** You can check your Neo4j version if you navigate to the Overview page of your database.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Please be aware that older versions of this driver are incompatible with GrapheneDB\",\n  \"body\": \"Older versions of this driver use TLS 1.0, which GrapheneDB does not support, as it is susceptible to attacks and can be a tremendous security liability.\"\n}\n[/block]\nTLS 1.2 is supported by this driver starting with version 1.1.0\n\nDriver page: https://github.com/neo4j/neo4j-dotnet-driver\nDriver NuGet package: https://www.nuget.org/packages/Neo4j.Driver\n\nTo install the .NET Neo4j Driver, run the following command in the Package Manager Console:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PM> Install-Package Neo4j.Driver\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nThe following example just sets up the connection and creates a dummy node:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"using System;\\nusing System.Collections.Generic;\\nusing System.Linq;\\nusing System.Text;\\nusing System.Threading.Tasks;\\nusing Neo4j.Driver.V1;\\n\\nnamespace ConsoleApplication1\\n{\\n    class Program\\n    {\\n        static void Main(string[] args)\\n        {\\n            var driver = GraphDatabase.Driver(\\\"bolt://hobby-geefdaeefcom.dbs.graphenedb.com:24786\\\", AuthTokens.Basic(\\\"v303\\\", \\\"GtGq5rldxu\\\"), Config.Builder.WithEncryptionLevel(EncryptionLevel.Encrypted).ToConfig());\\n          \\n            var session = driver.Session();\\n            using (var tx = session.BeginTransaction())\\n            {\\n                tx.Run(\\\"CREATE (n:Person {name:'Bob'})\\\");\\n                tx.Success();\\n            }\\n        }\\n    }\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\n## Neo4jClient\n\nA .NET client for Neo4j, designed to make it easy to write Cypher queries in C# with IntelliSense.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Please note\",\n  \"body\": \"This driver **does not support Bolt** connections at the time of writing this guide. The maintainers of this driver have stated Bolt support is coming soon. Please check on the status of Bolt support prior to connecting to GrapheneDB, if you wish to use Bolt.\"\n}\n[/block]\nDriver page: https://github.com/Readify/Neo4jClient\nDriver NuGet package: https://www.nuget.org/packages/Neo4jClient\n\nTo install Neo4jClient, run the following command in the Package Manager Console:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"PM> Install-Package Neo4jClient\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nSetting up the connection:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var client = new GraphClient(new Uri(\\\"http://v303:GtGq5rldxu:::at:::hobby-geefdaeefcom.dbs.graphenedb.com:24786\\\"));\\nclient.Connect();\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nAssuming a Person class:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"public class Person\\n{\\n    public string Name { get; set; }\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]\nPrint the existing Person’s node names:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var query = client.Cypher\\n    .Match(\\\"(person:Person)\\\")\\n    .Return(person => person.As<User>())\\n\\n\\nforeach (var result in query.Results)\\n{\\n    Console.WriteLine(result.Person.Name);\\n}\",\n      \"language\": \"csharp\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"net","type":"basic","title":".NET"}
If .NET is your language of choice, the most popular drivers are: * [Neo4j DotNet driver](#section-neo4j-bolt-driver-for-net) [official driver] * [Neo4jClient](#section-neo4jclient) [community driver] These drivers are shipped exclusively as a NuGet package. To use them in your projects, you will need to use the [Package Manager Console](https://docs.nuget.org/ndocs/tools/package-manager-console). [block:callout] { "type": "info", "body": "We've used test credentials for all the following examples. Please replace them with your real connection parameters.\n\nYou'll find all the required information to connect to your database on our admin panel if you navigate to the Connection section. More on connecting to your database [here](doc:connecting-to-your-database)", "title": "About connection parameters" } [/block] ## Neo4j Bolt driver for .NET The Neo4j .NET driver is the one officially supported by Neo4j and connects to the database using Bolt protocol (HTTP/HTTPS not available). [block:callout] { "type": "info", "body": "**Bolt protocol is available in 3.0.0 or higher versions of Neo4j.** You can check your Neo4j version if you navigate to the Overview page of your database." } [/block] [block:callout] { "type": "warning", "title": "Please be aware that older versions of this driver are incompatible with GrapheneDB", "body": "Older versions of this driver use TLS 1.0, which GrapheneDB does not support, as it is susceptible to attacks and can be a tremendous security liability." } [/block] TLS 1.2 is supported by this driver starting with version 1.1.0 Driver page: https://github.com/neo4j/neo4j-dotnet-driver Driver NuGet package: https://www.nuget.org/packages/Neo4j.Driver To install the .NET Neo4j Driver, run the following command in the Package Manager Console: [block:code] { "codes": [ { "code": "PM> Install-Package Neo4j.Driver", "language": "shell" } ] } [/block] The following example just sets up the connection and creates a dummy node: [block:code] { "codes": [ { "code": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing Neo4j.Driver.V1;\n\nnamespace ConsoleApplication1\n{\n class Program\n {\n static void Main(string[] args)\n {\n var driver = GraphDatabase.Driver(\"bolt://hobby-geefdaeefcom.dbs.graphenedb.com:24786\", AuthTokens.Basic(\"v303\", \"GtGq5rldxu\"), Config.Builder.WithEncryptionLevel(EncryptionLevel.Encrypted).ToConfig());\n \n var session = driver.Session();\n using (var tx = session.BeginTransaction())\n {\n tx.Run(\"CREATE (n:Person {name:'Bob'})\");\n tx.Success();\n }\n }\n }\n}", "language": "csharp" } ] } [/block] ## Neo4jClient A .NET client for Neo4j, designed to make it easy to write Cypher queries in C# with IntelliSense. [block:callout] { "type": "info", "title": "Please note", "body": "This driver **does not support Bolt** connections at the time of writing this guide. The maintainers of this driver have stated Bolt support is coming soon. Please check on the status of Bolt support prior to connecting to GrapheneDB, if you wish to use Bolt." } [/block] Driver page: https://github.com/Readify/Neo4jClient Driver NuGet package: https://www.nuget.org/packages/Neo4jClient To install Neo4jClient, run the following command in the Package Manager Console: [block:code] { "codes": [ { "code": "PM> Install-Package Neo4jClient", "language": "shell" } ] } [/block] Setting up the connection: [block:code] { "codes": [ { "code": "var client = new GraphClient(new Uri(\"http://v303:GtGq5rldxu@hobby-geefdaeefcom.dbs.graphenedb.com:24786\"));\nclient.Connect();", "language": "csharp" } ] } [/block] Assuming a Person class: [block:code] { "codes": [ { "code": "public class Person\n{\n public string Name { get; set; }\n}", "language": "csharp" } ] } [/block] Print the existing Person’s node names: [block:code] { "codes": [ { "code": "var query = client.Cypher\n .Match(\"(person:Person)\")\n .Return(person => person.As<User>())\n\n\nforeach (var result in query.Results)\n{\n Console.WriteLine(result.Person.Name);\n}", "language": "csharp" } ] } [/block]