FlyTech.Dependable 1.0.11

dotnet add package FlyTech.Dependable --version 1.0.11
                    
NuGet\Install-Package FlyTech.Dependable -Version 1.0.11
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FlyTech.Dependable" Version="1.0.11" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FlyTech.Dependable" Version="1.0.11" />
                    
Directory.Packages.props
<PackageReference Include="FlyTech.Dependable" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FlyTech.Dependable --version 1.0.11
                    
#r "nuget: FlyTech.Dependable, 1.0.11"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FlyTech.Dependable@1.0.11
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FlyTech.Dependable&version=1.0.11
                    
Install as a Cake Addin
#tool nuget:?package=FlyTech.Dependable&version=1.0.11
                    
Install as a Cake Tool

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.

Buy me coffee

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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