Skip to content

kengwang/Depository

Repository files navigation

Depository

An IoC Container with fantastic feature.

Unit Tests NuGet
Depository.Core Unit Tests Nuget

Feature

  • 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> but ResolveMultiple)
  • Nullable Injection
  • Proxy/Decoration Service Support
  • Microsoft.Extension.Hosting intergration
  • Notification / Pipeline structure
  • Seemly high perfomance
  • ......

Checkout Wiki

NativeAOT Support

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.

Local Commands

Run tests under JIT:

dotnet test Depository.Tests/Depository.Tests.csproj -c Release --verbosity normal

Publish and run tests under NativeAOT:

dotnet publish Depository.Tests/Depository.Tests.csproj -c Release -r win-x64 -o out/aot
./out/aot/Depository.Tests.exe

Verified Platform

AOT is currently verified on win-x64 only. Cross-platform AOT is not claimed.

CI Behavior

  • unit-test.yml runs a matrix: JIT on ubuntu-latest and windows-latest, plus AOT on windows-latest (win-x64).
  • nuget-push.yml gates NuGet publishing on the test-aot job, which runs both JIT tests and AOT publish/run on win-x64.

Analyzer Warning Policy

Fix trim and AOT analyzer warnings at the source. Narrow suppressions are acceptable when justified. Blanket suppressions are not allowed.

Licence

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.

About

An IoC Container with amazing features

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages