EZServiceLocator 1.0.4
dotnet add package EZServiceLocator --version 1.0.4
NuGet\Install-Package EZServiceLocator -Version 1.0.4
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="EZServiceLocator" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EZServiceLocator --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EZServiceLocator, 1.0.4"
#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 EZServiceLocator as a Cake Addin #addin nuget:?package=EZServiceLocator&version=1.0.4 // Install EZServiceLocator as a Cake Tool #tool nuget:?package=EZServiceLocator&version=1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
##Introduction You need a service locator with automated dependency injection support? No need for heavyweight IoC Containers with so many options and functionalities? This library provides exactly this!!!
##Sample mapping class
public class TestAppMap : ServiceMap
{
public override void Load()
{
For<INavigationRepository>().Use<NavigationCassandraRepository>();
For<ITracker>().Use<Tracking>(new ConstructorDependency(typeof(INavigationRepository)));
}
}
##Specific mapping
ServiceLocator.Current.For<INavigationRepository>().Use<NavigationMsSqlRepository>();
##Named instance mapping
ServiceLocator.Current.For<INavigationRepository>("sql").Use<NavigationMsSqlRepository>();
##Self mapping
ServiceLocator.Current.Use<TestAppMap>();
##Service get
ServiceLocator.Current.LoadServiceMap<TestAppMap>();
##Named instance get
ServiceLocator.Current.GetService<INavigationRepository>("sql");
##Upcoming updates
- Support to named instance injection
- Support to property injection
- JSON mapping
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
- Easy Service Mapping
- Named Instances
- NO NINJECT