{"id":29890018,"url":"https://github.com/aoxetech/aoxe.dependencyinjection.extensions","last_synced_at":"2026-01-20T17:52:53.664Z","repository":{"id":260596861,"uuid":"881789760","full_name":"AoxeTech/Aoxe.DependencyInjection.Extensions","owner":"AoxeTech","description":"The extensions for DependencyInjection","archived":false,"fork":false,"pushed_at":"2025-07-12T01:37:29.000Z","size":40,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T08:56:08.240Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/AoxeTech.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":"2024-11-01T08:28:45.000Z","updated_at":"2025-07-12T01:37:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"c565b7cf-15ac-4f0d-af0a-03521ce24265","html_url":"https://github.com/AoxeTech/Aoxe.DependencyInjection.Extensions","commit_stats":null,"previous_names":["aoxetech/aoxe.dependencyinjection.extensions"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AoxeTech/Aoxe.DependencyInjection.Extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.DependencyInjection.Extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.DependencyInjection.Extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.DependencyInjection.Extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.DependencyInjection.Extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AoxeTech","download_url":"https://codeload.github.com/AoxeTech/Aoxe.DependencyInjection.Extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AoxeTech%2FAoxe.DependencyInjection.Extensions/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268126587,"owners_count":24200290,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"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":[],"created_at":"2025-07-31T22:23:24.288Z","updated_at":"2026-01-20T17:52:53.631Z","avatar_url":"https://github.com/AoxeTech.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aoxe.DependencyInjection.Extensions\n\nAoxe.DependencyInjection.Extensions provides extension methods for Microsoft's Dependency Injection container to simplify service registration with Lazy\\\u003cT\\\u003e support. These extensions allow for deferred instantiation of services, improving performance by delaying object creation until it's actually needed.\n\n## Features\n\n- Extension methods to register services with Lazy\\\u003cT\\\u003e\n  - AddSingletonWithLazy\n  - AddScopedWithLazy\n  - AddTransientWithLazy\n- Support for both type and factory-based registrations\n- Simplifies the use of Lazy\\\u003cT\\\u003e in dependency injection scenarios\n\n## Installation\n\nTo install the package, add the following to your project file:\n\n```xml\n\u003cPackageReference Include=\"Aoxe.DependencyInjection.Extensions\" Version=\"2024.1.0\" /\u003e\n```\n\nOr use the .NET CLI:\n\n```bash\ndotnet add package Aoxe.DependencyInjection.Extensions\n```\n\n## Usage\n\nFirst, include the namespace:\n\n```csharp\nusing Aoxe.DependencyInjection.Extensions;\n```\n\n### Registering Services\n\n#### Singleton Services\n\nUse the 'AddSingletonWithLazy' method to register singleton services with Lazy\\\u003cT\\\u003e support:\n\n```csharp\nservices.AddSingletonWithLazy\u003cIMyService, MyServiceImplementation\u003e();\n```\n\n#### Scoped Services\n\nFor scoped services, use the 'AddScopedWithLazy' method:\n\n```csharp\nservices.AddScopedWithLazy\u003cIMyService, MyServiceImplementation\u003e();\n```\n\n#### Transient Services\n\nFor transient services, use the 'AddTransientWithLazy' method:\n\n```csharp\nservices.AddTransientWithLazy\u003cIMyService, MyServiceImplementation\u003e();\n```\n\n### Accessing Services\n\nInject Lazy\\\u003cT\\\u003e into your classes to defer service instantiation:\n\n```csharp\npublic class MyController\n{\n    private readonly Lazy\u003cIMyService\u003e _myService;\n\n    public MyController(Lazy\u003cIMyService\u003e myService)\n    {\n        _myService = myService;\n    }\n\n    public void DoWork()\n    {\n        // The IMyService instance is created only when accessed\n        _myService.Value.PerformOperation();\n    }\n}\n```\n\n## Examples\n\nRefer to the unit tests for more examples:\n\n- AddSingletonUnitTest.cs\n- AddScopedUnitTest.cs\n- AddTransientUnitTest.cs\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Contributing\n\nContributions are welcome! Please submit issues or pull requests to the [GitHub repository](https://github.com/AoxeTech/Aoxe.DependencyInjection.Extensions).\n\n---\n\nThank`s for [JetBrains](https://www.jetbrains.com/) for the great support in providing assistance and user-friendly environment for my open source projects.\n\n[![JetBrains](https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.svg?_gl=1*f25lxa*_ga*MzI3ODk2MjY0LjE2NzA0NjY4MDQ.*_ga_9J976DJZ68*MTY4OTY4NzY5OS4zNC4xLjE2ODk2ODgwMDAuNTMuMC4w)](https://www.jetbrains.com/community/opensource/#support)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.dependencyinjection.extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faoxetech%2Faoxe.dependencyinjection.extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faoxetech%2Faoxe.dependencyinjection.extensions/lists"}