Microsoft.Extensions.DependencyInjection 10.0.0-preview.5.25277.114
About
Supports the dependency injection (DI) software design pattern which is a technique for achieving Inversion of Control (IoC) between classes and their dependencies.
Key Features
Provides an implementation of the DI interfaces found in the Microsoft.Extensions.DependencyInjection.Abstractions
package.
How to Use
ServiceCollection services = new ();
services.AddSingleton<IMessageWriter, MessageWriter>();
using ServiceProvider provider = services.BuildServiceProvider();
// The code below, following the IoC pattern, is typically only aware of the IMessageWriter interface, not the implementation.
IMessageWriter messageWriter = provider.GetService<IMessageWriter>()!;
messageWriter.Write("Hello");
public interface IMessageWriter
{
void Write(string message);
}
internal class MessageWriter : IMessageWriter
{
public void Write(string message)
{
Console.WriteLine($"MessageWriter.Write(message: \"{message}\")");
}
}
Main Types
The main types provided by this library are:
Microsoft.Extensions.DependencyInjection.DefaultServiceProviderFactory
Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions
Microsoft.Extensions.DependencyInjection.ServiceProvider
Additional Documentation
- Conceptual documentation
- API documentation
Related Packages
Microsoft.Extensions.DependencyInjection.Abstractions
Microsoft.Extensions.Hosting
Microsoft.Extensions.Options
Feedback & Contributing
Microsoft.Extensions.DependencyInjection is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.
Showing the top 20 packages that depend on Microsoft.Extensions.DependencyInjection.
Packages | Downloads |
---|---|
Pomelo.EntityFrameworkCore.MySql.Design
Package Description
|
4 |
Npgsql.EntityFrameworkCore.PostgreSQL
PostgreSQL/Npgsql provider for Entity Framework Core.
|
3 |
Microsoft.Orleans.Core
Core library of Microsoft Orleans used both on the client and server.
|
3 |
Microsoft.Orleans.Reminders.AzureStorage
Microsoft Orleans reminders provider backed by Azure Table Storage
|
3 |
Serilog.AspNetCore
Serilog support for ASP.NET Core logging
|
3 |
Microsoft.Orleans.Core
Core library of Microsoft Orleans used both on the client and server.
|
2 |
Microsoft.VisualStudio.Web.CodeGeneration
Contains the CodeGenCommand that finds the appropriate code generator and invokes it from project dependencies.
|
2 |
Pomelo.EntityFrameworkCore.MySql
Pomelo's MySQL database provider for Entity Framework Core.
|
2 |
Microsoft.AspNetCore.DataProtection.Extensions
Additional APIs for ASP.NET Core data protection.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/704f7cb1d2cea33afb00c2097731216f121c2c73
|
2 |
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
|
2 |
Microsoft.ServiceFabric.AspNetCore.Abstractions
This package provides abstractions for creating AspNetCore Service Fabric microservices.
|
2 |
Microsoft.AspNetCore.App
Microsoft.AspNetCore.App
|
2 |
Microsoft.Orleans.Streaming.AzureStorage
Microsoft Orleans streaming provider backed by Azure Queue Storage
|
2 |
Serilog.Extensions.Logging
Low-level Serilog provider for Microsoft.Extensions.Logging
|
2 |
Microsoft.AspNetCore.Mvc.Localization
ASP.NET Core MVC features that enable globalization and localization of applications.
Commonly used types:
Microsoft.AspNetCore.Mvc.Localization.IHtmlLocalizer<TResource>
Microsoft.AspNetCore.Mvc.Localization.IViewLocalizer
|
2 |
Microsoft.Orleans.Persistence.AzureStorage
Microsoft Orleans persistence providers backed by Azure Storage
|
2 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0-preview.5.25277.114)
- System.Threading.Tasks.Extensions (>= 4.6.3)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
.NET Standard 2.1
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
.NET Standard 2.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.0-preview.5.25277.114)
- System.Threading.Tasks.Extensions (>= 4.6.3)
.NET 10.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
.NET 8.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)
.NET 9.0
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.0-preview.5.25277.114)