Skip to content

existall/Shepherd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExistsForAll

ExistsForAll.Shepherd.SimpleInjector

installation

Install-Package ExistsForAll.Shepherd.SimpleInjector

Intoduction

SimpleInjector is a great IoC Container, over the years it became my go to DI for every project.
Thus we've developed methodologies to register infrastructure and domain services quickly.
Shepherd should act as your Composition Root in your application startup.

Table of Content

  1. Getting started
  2. SimpleInjector Configuration
  3. Assemblies
  4. Modules
  5. Auto-Registration

Getting Started

var shepherd = new Shepherd();
var container = shepherd.AddPublicTypesAssemblies(Assemblies)
			.AddModule(LoggingModule, DataAccessModule, ConfigurationModule)
			.Herd();

Shepherd will gather all the types from the given assemblies (all or only public), iterate over all the modules by order of insertion and auto-register all remaining domain services. The return value from the Herd() method is SimpleInjector container.

Order of actions

  1. The first thing Shepherd does after validation and configuration is to gather all the types from the given assemblies.
  2. Then Shepherd Will iterate over all the Modules in the order of insertion, after that Shepherd will index.
  3. Shepherd will index all interfaces to matching implementation and will register them as explained in the Auto-Registration section.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published