HCI.Core.Helper
1.0.2
ASP.NET Core help tools
See the version list below for details.
Install-Package HCI.Core.Helper -Version 1.0.2
dotnet add package HCI.Core.Helper --version 1.0.2
<PackageReference Include="HCI.Core.Helper" Version="1.0.2" />
paket add HCI.Core.Helper --version 1.0.2
#r "nuget: HCI.Core.Helper, 1.0.2"
HCI.Core.Helper
Features
HCI.Core.Helper is a NuGet library that you can automatically register all services by following the name pattern by assembly.
The following platforms are supported:
- .NET Core
Getting started
The easiest way to get started is by installing the available NuGet packages and if you're not a NuGet fan then follow these steps:
Download the latest runtime library from: https://www.nuget.org/api/v2/package/HCI.Core.Helper.
Or install the latest package:
PM> Install-Package HCI.Core.Helper
A Quick Example
Services Register
Automatically register all services by following the name pattern by assembly.
- In
Startup.cs
enter the code according to line 4 at the end of theConfigureServices
method; - Use the
ServicesRegister
class to trigger the desired method; - Enter the service container;
- Enter the assembly of a project implementation target of the dependency injection;
- Enter the suffix pattern for the services to be registered;
- Optionally, enter a suffix pattern for the used contract.
Add services as scope
public void ConfigureServices(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesScope(services, typeof(FooService).Assembly, "Service");
}
Add services as singleton
public void ConfigureServices(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesSingleton(services, typeof(FooService).Assembly, "Service");
}
Add services as transient
public void AddServicesTransient(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesScope(services, typeof(FooService).Assembly, "Service");
}
Report Support
To report errors, questions and suggestions go to the link
HCI.Core.Helper
Features
HCI.Core.Helper is a NuGet library that you can automatically register all services by following the name pattern by assembly.
The following platforms are supported:
- .NET Core
Getting started
The easiest way to get started is by installing the available NuGet packages and if you're not a NuGet fan then follow these steps:
Download the latest runtime library from: https://www.nuget.org/api/v2/package/HCI.Core.Helper.
Or install the latest package:
PM> Install-Package HCI.Core.Helper
A Quick Example
Services Register
Automatically register all services by following the name pattern by assembly.
- In
Startup.cs
enter the code according to line 4 at the end of theConfigureServices
method; - Use the
ServicesRegister
class to trigger the desired method; - Enter the service container;
- Enter the assembly of a project implementation target of the dependency injection;
- Enter the suffix pattern for the services to be registered;
- Optionally, enter a suffix pattern for the used contract.
Add services as scope
public void ConfigureServices(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesScope(services, typeof(FooService).Assembly, "Service");
}
Add services as singleton
public void ConfigureServices(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesSingleton(services, typeof(FooService).Assembly, "Service");
}
Add services as transient
public void AddServicesTransient(IServiceCollection services)
{
// TODO code here.
ServicesRegister.AddServicesScope(services, typeof(FooService).Assembly, "Service");
}
Report Support
To report errors, questions and suggestions go to the link
Release Notes
Bug fix
Dependencies
-
.NETCoreApp 2.1
- Microsoft.Extensions.DependencyInjection (>= 2.1.1)
Used By
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.