{"id":15690207,"url":"https://github.com/kant2002/storekeeper","last_synced_at":"2025-10-11T23:17:03.318Z","repository":{"id":38018241,"uuid":"487254318","full_name":"kant2002/storekeeper","owner":"kant2002","description":"AOT friendly dependency injection","archived":false,"fork":false,"pushed_at":"2023-01-30T17:49:38.000Z","size":125,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-07T08:18:21.494Z","etag":null,"topics":["ioc-container","nativeaot"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kant2002.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","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":"2022-04-30T11:03:05.000Z","updated_at":"2024-06-24T03:47:57.000Z","dependencies_parsed_at":"2024-10-09T13:45:10.359Z","dependency_job_id":null,"html_url":"https://github.com/kant2002/storekeeper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kant2002%2Fstorekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kant2002%2Fstorekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kant2002%2Fstorekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kant2002%2Fstorekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kant2002","download_url":"https://codeload.github.com/kant2002/storekeeper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243042903,"owners_count":20226720,"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":["ioc-container","nativeaot"],"created_at":"2024-10-03T18:08:18.624Z","updated_at":"2025-10-11T23:16:58.283Z","avatar_url":"https://github.com/kant2002.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Store Keeper\n============\n\nNice store keeper, keeps all you classes in the store. All dependencies would be stored there. Also AOT friendly.\n\n# How to use\n\nAdd `SqlMarshal` Nuget package using\n\n```\ndotnet add package StoreKeeper\n```\n\nTo try it out, look at the `StoreKeeper.CompilationTests` project.\nTo run test suite\n\n    dotnet run --project StoreKeeper.CompilationTests/StoreKeeper.CompilationTests.csproj \n\n# AOT preparation example\n\nThis library augment your calls of AddScoped/AddTransient/AddSingleton, etc to make your DI registriation works in reflection-free mode.\n\n```csharp\nvar serviceContainer = new ServiceCollection();\nserviceContainer.AddScoped\u003cEnglishGreeting\u003e();\nserviceContainer.AddScoped\u003cIGreeting, EnglishGreeting\u003e();\nvar serviceProvider = serviceContainer.BuildServiceProvider();\n\n// Registration\ninterface IGreeting\n{\n    string SayHello(string name);\n}\n\ninternal class EnglishGreeting : IGreeting\n{\n    public string SayHello(string name)\n    {\n        return $\"Hello {name}!\";\n    }\n}\n```\n\nYou do not need to do anything except recompilation of the project, after adding library.\nSource generator make sure that your code would work in reflection-free mode. \nRegular NativeAOT mode can also use better code generation pattern and do not rely on reflection.\n\n# Samples\n\nLook for samples quick samples https://github.com/kant2002/storekeeper.samples \n\n# Experimental statically resolving container\n\nAlmost identical with ServiceCollection usage except `BuildServiceProviderAot` method produce statically constructed service provider.\n\n```csharp\nvar serviceContainer = new ServiceCollection();\nserviceContainer.AddScoped\u003cEnglishGreeting\u003e();\nserviceContainer.AddScoped\u003cIGreeting, EnglishGreeting\u003e();\nvar serviceProvider = serviceContainer.BuildServiceProviderAot();\n```\n\n## Implementation plan for experimental statically resolving container\n\n- [x] Scoped registration using class.\n- [x] Scoped registration using interface.\n- [x] Scoped registration using `Func\u003cT\u003e`.\n- [x] Scoped registration using instance object.\n- [x] Implement disposing scope services.\n- [ ] Implement asynchronous disposing scope services.\n- [x] Implement singleton services.\n- [ ] Implement transient services.\n- [x] Dependency resolution.\n- [ ] Support derived from ServiceCollection classes.\n- [ ] Support for `BuildServiceProvider`.\n- [ ] Support for `IEnumerable\u003cT\u003e` services.\n- [ ] Dynamic registration of services.\n- [ ] Registrations across assemblies.\n- [ ] Generic Host support.\n- [ ] Services with `internal` visibility.\n- [x] Add `UseAotServices` method which will replace all service registration within assembly.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkant2002%2Fstorekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkant2002%2Fstorekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkant2002%2Fstorekeeper/lists"}