https://github.com/kant2002/storekeeper.samples
Samples for StoreKeeper DI augmentation lib
https://github.com/kant2002/storekeeper.samples
Last synced: over 1 year ago
JSON representation
Samples for StoreKeeper DI augmentation lib
- Host: GitHub
- URL: https://github.com/kant2002/storekeeper.samples
- Owner: kant2002
- License: mit
- Created: 2022-06-17T06:52:07.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-06-17T06:52:11.000Z (about 4 years ago)
- Last Synced: 2024-10-11T20:48:37.734Z (almost 2 years ago)
- Language: C#
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
StoreKeeper Samples
===================
This is samples for the [StoreKeeper](https://github.com/kant2002/storekeeper) which augments your DI container to make it work in Reflection-free mode.
You add Nuget package.
```sh
dotnet add package StoreKeeper
```
Then you add custom Nuget feed for latest NativeAOT compiler with fixes.
```sh
dotnet new nugetoconfig
```
Add `dotnet7` feed to nuget.config
```xml
```
And that's it unless you are using open generics as service registration.
```csharp
// Build your DI container as usual.
var serviceCollection = new ServiceCollection();
serviceCollection.AddScoped();
var provider = serviceCollection.BuildServiceProvider();
// Use your service provider as usual.
var wrapper = provider.GetRequiredService();
wrapper.WriteLine("Bye Bye Reflection!");
```