Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Yeah69/MrMeeseeks.DIE
Compile-time dependency injection container which requires minimal configuration
https://github.com/Yeah69/MrMeeseeks.DIE
csharp csharp-sourcegenerator di-container dotnet source-generator source-generators
Last synced: 3 months ago
JSON representation
Compile-time dependency injection container which requires minimal configuration
- Host: GitHub
- URL: https://github.com/Yeah69/MrMeeseeks.DIE
- Owner: Yeah69
- License: mit
- Created: 2021-08-01T08:18:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-27T10:33:29.000Z (3 months ago)
- Last Synced: 2024-07-28T06:51:48.997Z (3 months ago)
- Topics: csharp, csharp-sourcegenerator, di-container, dotnet, source-generator, source-generators
- Language: C#
- Homepage:
- Size: 19.3 MB
- Stars: 6
- Watchers: 5
- Forks: 0
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- RSCG_Examples - MrMeeseeks.DIE
- csharp-source-generators - MrMeeseeks.DIE - ![stars](https://img.shields.io/github/stars/Yeah69/MrMeeseeks.DIE?style=flat-square&cacheSeconds=604800) ![last commit](https://img.shields.io/github/last-commit/Yeah69/MrMeeseeks.DIE?style=flat-square&cacheSeconds=86400) An unambigous, convenient, flexible and feature rich compile time dependency injection container. (Source Generators / Dependency Injection (IoC Container))
README
# Welcome to MrMeeseeks.DIE
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://matrix.to/#/#Yeah69_MrMeeseeks.DIE:gitter.im)
[![SOQnA](https://img.shields.io/badge/StackOverflow-QnA-green.svg)](http://stackoverflow.com/questions/tagged/MrMeeseeks.DIE)DIE is a secret agency organized by a bunch of Mr. Meeseekses. Its goal is to gather the information necessary to resolve your dependencies. Therefore, …
> The acronym DIE stands for **D**ependency **I**njection DI**E**
Let the secret agency DIE compose these info in order to build factory methods which create instances of types of your choice.
## Introduction
MrMeeseeks.DIE (in this documentation just referred to as DIE) is a compile-time dependency injection container for .Net. As such it generates factory methods which create instances that you need. Instead of relying on reflection the generated code uses the good old `new` operator to create instances like you would probably do yourself if you'd create a pure DI container.
## Nuget
The easiest way to use DIE is to get it via nuget. Here is the package page:
https://www.nuget.org/packages/MrMeeseeks.DIE/
Either search for MrMeeseeks.DIE in the nuget manager of the IDE of your choice.
Or call the following PowerShell command:
```powershell
Install-Package MrMeeseeks.DIE
```Or manually insert the package reference into the target `.csproj`:
```xml
```
Or manually add the package reference to the target `.csproj`:
```xml
```
## Characteristics Of DIE
- Compile-Time Code Generation
- Incomplete configurations will most likely result in a failed build
- Unambiguousness
- Container doesn't resolve ambiguity through assumptions
- Configuration features to resolve ambiguities
- Convenience
- Default behaviors designed to reduce the amount of configuration required
- Optional marker interfaces can be used for configurations
- Mass configuration (e.g., register all implementations with a single configuration)
- Flexibility
- Allows opt-in configuration style
- Allows opt-out configuration style
- Feature richness
- Scoping
- Async support
- Generics support
- User-defined elements (factories, custom parameters, …)
- Generated factories (Func<…>, Lazy<…>)
- Decorators & Composites
- Collection injections (IEnumerable<…>, IAsyncEnumerable<…>, IList<…> and many more)
- Maximum transparency
- Only your configuration code needs to know about DIE
- The rest of your code base can remain oblivious## Documentation
Please visit https://die.mrmeeseeks.dev/ for a documentation.