EZServiceLocator 1.0.3

There is a newer version of this package available.
See the version list below for details.
Install-Package EZServiceLocator -Version 1.0.3
dotnet add package EZServiceLocator --version 1.0.3
<PackageReference Include="EZServiceLocator" Version="1.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EZServiceLocator --version 1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: EZServiceLocator, 1.0.3"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. 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.3

// Install EZServiceLocator as a Cake Tool
#tool nuget:?package=EZServiceLocator&version=1.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Build status Nuget count

##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

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.

Version Downloads Last updated
1.0.4 709 5/22/2018
1.0.3 1,114 11/19/2015
1.0.2 694 11/17/2015
1.0.1 728 9/9/2015
1.0.0 1,019 6/16/2015

- Easy Service Mapping
- Named Instances
- NO NINJECT