FlyTech.Dependable
1.0.11
dotnet add package FlyTech.Dependable --version 1.0.11
NuGet\Install-Package FlyTech.Dependable -Version 1.0.11
<PackageReference Include="FlyTech.Dependable" Version="1.0.11" />
<PackageVersion Include="FlyTech.Dependable" Version="1.0.11" />
<PackageReference Include="FlyTech.Dependable" />
paket add FlyTech.Dependable --version 1.0.11
#r "nuget: FlyTech.Dependable, 1.0.11"
#:package FlyTech.Dependable@1.0.11
#addin nuget:?package=FlyTech.Dependable&version=1.0.11
#tool nuget:?package=FlyTech.Dependable&version=1.0.11
FlyTech Dependable
Introduction
Dependency Injection is a crucial part of sofware design. It is a design pattern that allows the removal of hard-coded dependencies and makes it possible to change them, whether at run-time or compile-time. This is a very important feature for testing a software system.
Managing dependencies can be a complex task, especially when the software system is large and complex. In this project, we will implement a simple dependency injection framework that will help us manage dependencies in a software system.
How to use the framework
The framework is very simple to use. You just need to add the IScoped to the class that you want to inject. The framework will automatically inject the dependencies for you. Not all dependencies are scoped. Therefore you may want to use the ITransient or ISingleton to specify the scope of the dependency.
Marking a class or interface as a dependency
Here is an example of how to use the framework:
public interface IMyDependency : IScoped
{
void DoSomething();
}
Or for a transient:
public interface IMyDependency : ITransient
{
void DoSomething();
}
Or for a singleton:
public interface IMyDependency : ISingleton
{
void DoSomething();
}
Registering dependencies
To register the dependencies, you need to add the following code to the startup pipeline:
var builder = WebApplication.CreateBuilder(args);
builder.services.RegisterDependencies();
var app = builder.Build();
Like this package?
If you like this package, buy me a coffee so I can continue to develop more packages like this.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.11 | 190 | 5/14/2024 |