{"id":25641985,"url":"https://github.com/cryptoc1/litedbcontext","last_synced_at":"2026-06-15T02:32:58.903Z","repository":{"id":277431278,"uuid":"932408406","full_name":"Cryptoc1/LiteDbContext","owner":"Cryptoc1","description":"A light-weight async wrapper for LiteDB","archived":false,"fork":false,"pushed_at":"2026-03-29T20:30:53.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2026-03-29T20:54:22.370Z","etag":null,"topics":["dotnet","litedb"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Cryptoc1.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-13T21:34:52.000Z","updated_at":"2026-03-29T20:30:03.000Z","dependencies_parsed_at":"2025-03-07T18:22:09.098Z","dependency_job_id":"e94e269f-49ca-4a16-abdc-b2d9e629094a","html_url":"https://github.com/Cryptoc1/LiteDbContext","commit_stats":null,"previous_names":["cryptoc1/litedbcontext"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Cryptoc1/LiteDbContext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cryptoc1%2FLiteDbContext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cryptoc1%2FLiteDbContext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cryptoc1%2FLiteDbContext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cryptoc1%2FLiteDbContext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Cryptoc1","download_url":"https://codeload.github.com/Cryptoc1/LiteDbContext/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Cryptoc1%2FLiteDbContext/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34345577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-15T02:00:07.085Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","litedb"],"created_at":"2025-02-23T05:16:51.401Z","updated_at":"2026-06-15T02:32:58.898Z","avatar_url":"https://github.com/Cryptoc1.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiteDbContext\n\n![Language](https://img.shields.io/github/languages/top/cryptoc1/LiteDbContext)\n[![Dependencies](https://img.shields.io/librariesio/github/cryptoc1/LiteDbContext)](https://libraries.io/nuget/LiteDbContext)\n[![Checks](https://img.shields.io/github/checks-status/cryptoc1/LiteDbContext/develop)](https://github.com/Cryptoc1/LiteDbContext/actions/workflows/default.yml)\n[![Coverage](https://img.shields.io/codecov/c/github/cryptoc1/LiteDbContext)](https://app.codecov.io/gh/Cryptoc1/LiteDbContext/)\n[![Version](https://img.shields.io/nuget/vpre/LiteDbContext)](https://www.nuget.org/packages/LiteDbContext)\n\nA light-weight async wrapper around [LiteDB](https://github.com/litedb-org/LiteDB).\n\n### Key Features:\n- Modern C#\n- Supports cancellations\n\n## Usage\n\n1. Define a `LiteDbContext`:\n```csharp\nusing LiteDB;\n\n// ...\n\npublic sealed class ExampleDbContext(LiteDbOptions options) : LiteDbContext(options)\n{\n    // NOTE: if a `name` is not provided to `DbSet\u003cT\u003e(string? name)`, `[CallerMemberName]` will provide the `PropertyInfo.Name` for you, e.g. `Examples`\n    public LiteDbSet\u003cExampleEntity\u003e Examples =\u003e DbSet\u003cExampleEntity\u003e();\n}\n\npublic sealed record class ExampleEntity\n{\n    public required string Key { get; init; }\n    public string Value { get; init; }\n}\n```\n\n2. Add your `LiteDbContext` as a service:\n```csharp\n\nusing LiteDB.Extensions.DependencyInjection;\n\n// ...\n\nIServiceCollection services;\n\n // ...\n\nservices.AddLiteDbContext\u003cExampleDbContext\u003e(options =\u003e\n{\n    options.ConnectionString = \"...\";\n\n    options.Mapper.ConfigureExamples();\n});\n\n// ...\n\ninternal static class ExampleEntityConfiguration\n{\n    public static BsonMapper ConfigureExamples(this BsonMapper mapper)\n    {\n        mapper.Entity\u003cExampleEntity\u003e()\n            .Id(example =\u003e example.Key);\n\n        return mapper;\n    }\n}\n```\n\n3. Use you `LiteDbContext`:\n```csharp\npublic sealed class ExampleController\n{\n    [HttpGet]\n    public async Task\u003cActionResult\u003cExampleEntity[]\u003e\u003e Index(\n        [FromServices] ExampleDbContext context,\n        [FromQuery, Required] string query)\n    {\n        var examples = await context.Examples.Query()\n            .Where(example =\u003e example.Value.StartsWith( query ))\n            .ToArrayAsync(HttpContext.RequestAborted);\n\n        return Ok(examples);\n    }\n}\n```\n\n## _How'd He Do It?_\n\nWork against the database is synchronized via a queue, backed by an unbounded `Channel`.\n\nSee [`DbWorkQueue`](https://github.com/Cryptoc1/LiteDbContext/blob/develop/src/DbWorkQueue.cs).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptoc1%2Flitedbcontext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcryptoc1%2Flitedbcontext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcryptoc1%2Flitedbcontext/lists"}