An IoC Container with fantastic feature.
| Unit Tests | NuGet |
|---|---|
- Mutable Dependency Implementation
- Notify Implementation Change
- Async Construct (resolve
Task<T>or fire-and-forget) - Resolve with Constructor has Parameter That Are Not In Container
- Multiple Resolve Support (not only
IEnumerable<T>butResolveMultiple) - Nullable Injection
- Proxy/Decoration Service Support
Microsoft.Extension.Hostingintergration- Notification / Pipeline structure
Seemly high perfomance- ......
Checkout Wiki
Depository is validated with NativeAOT on win-x64: the test suite passes under both JIT and an AOT-published test host.
The source libraries target netstandard2.0 for broad compatibility. AOT validation runs through a net9.0 test host with PublishAot=true. APIs that resolve from a runtime Type can still surface IL3050 warnings because open-generic construction, IEnumerable<T> list creation, and notification type construction require dynamic generic instantiation. Prefer the generic extension methods when the service type is statically known, and treat the Type-based APIs as dynamic-code paths.
Run tests under JIT:
dotnet test Depository.Tests/Depository.Tests.csproj -c Release --verbosity normalPublish and run tests under NativeAOT:
dotnet publish Depository.Tests/Depository.Tests.csproj -c Release -r win-x64 -o out/aot
./out/aot/Depository.Tests.exeAOT is currently verified on win-x64 only. Cross-platform AOT is not claimed.
unit-test.ymlruns a matrix: JIT onubuntu-latestandwindows-latest, plus AOT onwindows-latest(win-x64).nuget-push.ymlgates NuGet publishing on thetest-aotjob, which runs both JIT tests and AOT publish/run onwin-x64.
Fix trim and AOT analyzer warnings at the source. Narrow suppressions are acceptable when justified. Blanket suppressions are not allowed.
MIT License
Copyright (c) 2024 Kengwang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.