Created
February 15, 2015 05:46
-
-
Save dejanvasic85/53e93c31cc458f84bb31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class UnityConfig | |
{ | |
public static IUnityContainer RegisterComponents() | |
{ | |
var container = new UnityContainer(); | |
// Register all repository classes automatically | |
// Register all service classes automatically in the business layer | |
container.RegisterTypes( | |
AllClasses.FromAssemblies(new[] | |
{ | |
Assembly.Load("Neemo"), | |
Assembly.Load("Neemo.CarParts"), | |
Assembly.Load("Neemo.CarParts.Repository"), | |
}), | |
WithMappings.FromMatchingInterface, | |
WithName.Default); | |
// Override a specific auto registration (above) by specifying an override | |
container.RegisterType<IImageService, IFileImageService>(new InjectionConstructor(HttpContext.Current.Server.MapPath("~/"), typeof(IConfig))) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment