Bat.Di
8.0.1
dotnet add package Bat.Di --version 8.0.1
NuGet\Install-Package Bat.Di -Version 8.0.1
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="Bat.Di" Version="8.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Bat.Di --version 8.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Bat.Di, 8.0.1"
#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.
// Install Bat.Di as a Cake Addin
#addin nuget:?package=Bat.Di&version=8.0.1
// Install Bat.Di as a Cake Tool
#tool nuget:?package=Bat.Di&version=8.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
For use Bat.Di just do it :
1- Install Bat.Di on your project
2- Create extension methods for register services This package support three IOC container :
- Microsoft
- Autofac
- DryIoc
for example :
public static class MicrosoftContainerExtension
{
public static IServiceCollection AddTransient(this IServiceCollection services, IConfiguration _configuration)
{
services.AddBatDynamicTransient(typeof(IUserService).Assembly);
services.AddTransient<IGenericRepo<Menu>, MenuRepo>();
return services;
}
public static IServiceCollection AddScoped(this IServiceCollection services, IConfiguration _configuration)
{
services.AddBatDynamicScoped(typeof(IUserService).Assembly);
return services;
}
public static IServiceCollection AddSingleton(this IServiceCollection services, IConfiguration _configuration)
{
services.AddBatDynamicSingleton(typeof(IUserService).Assembly);
services.AddSingleton<IMemoryCacheProvider, MemoryCacheProvider>();
return services;
}
}
3- Call this extensions method in configur service container for example :
builder.Services.AddSwaggerGen();
builder.Host.ConfigureContainer<IContainer>(container => ConfigureContainer(container));
var app = builder.Build();
void ConfigureContainer(IContainer container)
{
container.RegisterTransient(configuration);
container.RegisterScoped(configuration);
container.RegisterSingleton(configuration);
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- Autofac.Extensions.DependencyInjection (>= 7.1.0)
- Bat.Core (>= 1.1.8)
- DryIoc.Microsoft.DependencyInjection (>= 5.1.0)
-
net5.0
- Autofac.Extensions.DependencyInjection (>= 7.1.0)
- Bat.Core (>= 1.1.8)
- DryIoc.Microsoft.DependencyInjection (>= 5.1.0)
-
net6.0
- Autofac.Extensions.DependencyInjection (>= 7.2.0)
- Bat.Core (>= 6.0.1)
- DryIoc.Microsoft.DependencyInjection (>= 5.1.0)
-
net7.0
- Autofac.Extensions.DependencyInjection (>= 8.0.0)
- Bat.Core (>= 7.0.4)
- DryIoc.Microsoft.DependencyInjection (>= 6.1.0)
-
net8.0
- Autofac.Extensions.DependencyInjection (>= 9.0.0)
- Bat.Core (>= 8.0.1)
- DryIoc.Microsoft.DependencyInjection (>= 6.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Upgrade to Net8.0 and C#12.0
- Upgrade to Autofac.Extensions.DependencyInjection 8.0
- Upgrade to DryIoc.Microsoft.DependencyInjection 6.2.0