{"id":28700762,"url":"https://github.com/nebula-contrib/nebula-net","last_synced_at":"2025-09-03T02:35:14.057Z","repository":{"id":43150827,"uuid":"437782928","full_name":"nebula-contrib/nebula-net","owner":"nebula-contrib","description":"Nebula Graph .net Client","archived":false,"fork":false,"pushed_at":"2024-06-03T04:19:15.000Z","size":1010,"stargazers_count":18,"open_issues_count":4,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-13T15:33:34.608Z","etag":null,"topics":["dotnet","graphdatabase","hacktoberfest","nebula-graph","thrift-client"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/NebulaNet/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nebula-contrib.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-13T07:55:01.000Z","updated_at":"2024-12-09T00:03:22.000Z","dependencies_parsed_at":"2024-06-03T05:43:55.039Z","dependency_job_id":null,"html_url":"https://github.com/nebula-contrib/nebula-net","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nebula-contrib/nebula-net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebula-contrib%2Fnebula-net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebula-contrib%2Fnebula-net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebula-contrib%2Fnebula-net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebula-contrib%2Fnebula-net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nebula-contrib","download_url":"https://codeload.github.com/nebula-contrib/nebula-net/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nebula-contrib%2Fnebula-net/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259810961,"owners_count":22915134,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dotnet","graphdatabase","hacktoberfest","nebula-graph","thrift-client"],"created_at":"2025-06-14T11:40:47.096Z","updated_at":"2025-06-14T11:40:50.739Z","avatar_url":"https://github.com/nebula-contrib.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"## NebulaNet\n[![NuGet version (NebulaNet)](https://img.shields.io/nuget/v/NebulaNet.svg?style=flat-square)](https://www.nuget.org/packages/NebulaNet/)\n[![CI](https://github.com/shyboylpf/nebula-net/workflows/E2E/badge.svg)](https://github.com/shyboylpf/nebula-net/actions/workflows/ci.yml)\n[![license](https://img.shields.io/badge/license-Apache%202.0-green.svg)](https://github.com/shyboylpf/nebula-net/blob/master-matt/LICENSES/Apache-2.0.txt)\n[![issues](https://img.shields.io/github/issues/shyboylpf/nebula-net.svg)](https://github.com/shyboylpf/nebula-net/issues)\n\nNebula NET client.\n\n## Install with .NET CLI\n\n[https://www.nuget.org/packages/NebulaNet/](https://www.nuget.org/packages/NebulaNet/)\n\n```shell\ndotnet add package NebulaNet\n```\n\nReleased [versions](https://www.nuget.org/packages/NebulaNet/#versions-tab) are mapped to Nebula Graph Core as following table:\n\n| nebula-net | NebulaGraph Core  |\n| ---------- | ----------------- |\n| 1.0.0      | 2.6.x             |\n| 3.0.0      | 3.x               |\n\n\n## Quick Start\n\n### Example-1:\n\n```csharp\nusing NebulaNet;\nusing System;\nusing System.Text;\nusing System.Threading.Tasks;\nNebulaConnection graphClient = new NebulaConnection();\nawait graphClient.OpenAsync(\"127.0.0.1\", 9669);\nvar authResponse = await graphClient.AuthenticateAsync(\"root\", \"123456\");\nConsole.WriteLine(authResponse.Session_id);\n\nStringBuilder sb = new StringBuilder();\nsb.Append(\"CREATE SPACE IF NOT EXISTS test(vid_type=FIXED_STRING(30));\");\nsb.Append(\"USE test;\");\nsb.Append(\"CREATE TAG IF NOT EXISTS person(name string, age int);\");\nsb.Append(\"CREATE EDGE like (likeness double);\");\n\nvar executionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, sb.ToString());\n\nawait Task.Delay(10000);\n\nexecutionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, \"INSERT VERTEX person(name, age) VALUES \\\"Bob\\\":(\\\"Bob\\\", 10), \\\"Lily\\\":(\\\"Lily\\\", 9);\");\nawait Task.Delay(5000);\nexecutionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, \"INSERT EDGE like(likeness) VALUES \\\"Bob\\\"-\u003e\\\"Lily\\\":(80.0);\");\nawait Task.Delay(5000);\nexecutionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, \"FETCH PROP ON person \\\"Bob\\\" YIELD vertex as node;\");\nawait Task.Delay(5000);\nexecutionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, \"FETCH PROP ON like \\\"Bob\\\"-\u003e\\\"Lily\\\" YIELD edge as e;\");\nawait Task.Delay(5000);\n\n// \nvar testDtos = await graphClient.ExecuteAsync(authResponse.Session_id, \"FETCH PROP ON person \\\"Bob\\\",\\\"Lily\\\" YIELD properties(vertex).name AS name,properties(vertex).age AS age;\")\n    .ToListAsync\u003cTestDto\u003e();\nforeach (var item in testDtos)\n{\n    Console.WriteLine($\"1.name:{item.Name},age:{item.Age}\");\n}\n\nexecutionResponse = await graphClient.ExecuteAsync(authResponse.Session_id, \"DROP SPACE test;\");\nawait Task.Delay(5000);\n\nawait graphClient.SignOutAsync(authResponse.Session_id);\n\npublic class TestDto\n{\n    public string Name { get; set; }\n    public long Age { get; set; }\n}\n```\n\n### Example-2(.NetCore):\n\nProgram.cs中配置：\n\n```csharp\nbuilder.Services.AddNebulaGraph(config =\u003e\n{\n    config.Ip=\"49.232.18.127\";\n    config.Port = 8669;\n});\n```\n\n使用：\n\n```csharp\npublic class NebulaGraphController : ControllerBase\n{\n    private readonly NebulaPool _nebulaConnPool;\n    public NebulaGraphController(NebulaPool nebulaConnPool)\n    {\n        _nebulaConnPool = nebulaConnPool;\n    }\n    \n    public async Task\u003cdynamic\u003e MatchMultipleTest(string questionId)\n    {\n        var session = await _nebulaConnPool.GetSessionAsync();\n\n        var output = await session.ExecuteAsync(\"FETCH PROP ON person \\\"Bob\\\",\\\"Lily\\\" YIELD properties(vertex).name AS name,properties(vertex).age AS age;\")\n            .ToListAsync\u003cTestDto\u003e();\n\n        session.Release();\n\n        return output;\n    }\n    \n    public class TestDto\n    {\n        public string Name { get; set; }\n        public long Age { get; set; }\n    }\n}\n```\n\n\n## License\n\nNebula NET is under Apache2.0 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebula-contrib%2Fnebula-net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnebula-contrib%2Fnebula-net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnebula-contrib%2Fnebula-net/lists"}