Microsoft.Extensions.DependencyInjection 10.0.1
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.DefaultServiceProviderFactoryMicrosoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensionsMicrosoft.Extensions.DependencyInjection.ServiceProvider
Additional Documentation
- Conceptual documentation
- API documentation
Related Packages
Microsoft.Extensions.DependencyInjection.AbstractionsMicrosoft.Extensions.HostingMicrosoft.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 |
|---|---|
|
DH.Magicodes.IE.Core
DH框架的Excel处理库。基于Magicodes.IE.Excel
|
4 |
|
Microsoft.SemanticKernel.Core
Semantic Kernel core orchestration, runtime and functions.
This package is automatically installed by 'Microsoft.SemanticKernel' package with other useful packages.
Install this package manually only if you are selecting individual Semantic Kernel components.
|
4 |
|
DH.Magicodes.IE.Core
DH框架的Excel处理库。基于Magicodes.IE.Excel
|
3 |
|
Microsoft.VisualStudio.Web.CodeGeneration.Design
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
|
3 |
|
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers.
This package was built from the source code at https://github.com/dotnet/aspnetcore/tree/f736effe82a61eb6f5eba46e4173eae3b7d3dffd
|
3 |
|
Microsoft.CodeAnalysis.Workspaces.MSBuild
.NET Compiler Platform ("Roslyn") support for analyzing MSBuild projects and solutions. This should be used with at least one
of the following packages to add the appropriate language support:
- Microsoft.CodeAnalysis.CSharp.Workspaces
- Microsoft.CodeAnalysis.VisualBasic.Workspaces
More details at https://aka.ms/roslyn-packages
This package was built from the source at https://github.com/dotnet/roslyn/commit/6c4a46a31302167b425d5e0a31ea83c9a9aa1d09.
|
3 |
|
Microsoft.VisualStudio.Web.CodeGeneration.Core
Contains the core infrastructure used by ASP.NET Core Code Generators.
|
2 |
|
Microsoft.VisualStudio.Web.CodeGenerators.Mvc
Code Generators for ASP.NET Core MVC. Contains code generators for MVC Controllers and Views.
|
2 |
|
Microsoft.VisualStudio.Web.CodeGeneration
Contains the CodeGenCommand that finds the appropriate code generator and invokes it from project dependencies.
|
2 |
|
Microsoft.VisualStudio.Web.CodeGeneration.EntityFrameworkCore
Contains Entity Framework Core Services used by ASP.NET Core Code Generators.
|
2 |
|
Magicodes.IE.Core
Import and export general library, support Dto import and export, template export, fancy export and dynamic export, support Excel, Csv, Word, Pdf and Html.
导入导出通用库,支持Dto导入导出、模板导出、花式导出以及动态导出,支持Excel、Csv、Word、Pdf和Html。
开源库地址:https://github.com/xin-lai
博客地址:http://www.cnblogs.com/codelove/
更新记录:https://github.com/dotnetcore/Magicodes.IE/blob/master/RELEASE.md
公众号:麦扣聊技术
交流QQ群:85318032
|
2 |
|
DH.Magicodes.IE.Core
DH框架的Excel处理库。基于Magicodes.IE.Excel
|
2 |
|
Microsoft.AspNetCore.Components.Web
Support for rendering ASP.NET Core components for browsers.
This package was built from the source code at https://github.com/dotnet/dotnet/tree/44525024595742ebe09023abe709df51de65009b
|
2 |
|
Microsoft.Maui.Controls.Core
.NET Multi-platform App UI (.NET MAUI) is a cross-platform framework for creating native mobile and desktop apps with C# and XAML. This package only contains the core C# and XAML objects used by .NET MAUI. Please install the Microsoft.Maui.Controls package to start using .NET MAUI.
|
2 |
|
Microsoft.Extensions.Logging
Logging infrastructure default implementation for Microsoft.Extensions.Logging.
|
2 |
|
Microsoft.AspNetCore.SignalR.Client.Core
Client for ASP.NET Core SignalR
This package was built from the source code at https://github.com/dotnet/dotnet/tree/89c8f6a112d37d2ea8b77821e56d170a1bccdc5a
|
2 |
|
Microsoft.VisualStudio.Web.CodeGeneration.Design
Code Generation tool for ASP.NET Core. Contains the dotnet-aspnet-codegenerator command used for generating controllers and views.
|
2 |
https://go.microsoft.com/fwlink/?LinkID=799421
.NET Framework 4.6.2
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.1)
- System.Threading.Tasks.Extensions (>= 4.6.3)
.NET 8.0
.NET 9.0
.NET 10.0
.NET Standard 2.0
- Microsoft.Bcl.AsyncInterfaces (>= 10.0.1)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.1)
- System.Threading.Tasks.Extensions (>= 4.6.3)