예제 #1
0
 /// <summary>
 /// Registers the type mappings with the Unity container.
 /// </summary>
 /// <param name="container">The unity container to configure.</param>
 /// <remarks>
 /// There is no need to register concrete types such as controllers or
 /// API controllers (unless you want to change the defaults), as Unity
 /// allows resolving a concrete type even if it was not previously
 /// registered.
 /// </remarks>
 public static void RegisterTypes(IUnityContainer container)
 {
     container.RegisterInstance(EmployeeMapperConfig.CreateMapper());
     container.RegisterType <EFDbContext>(new InjectionConstructor(new EmployeeContext()));
     container.RegisterType <IDbContext, EFDbContext>();
     container.RegisterType <IEmployeeService, EmployeeService>();
     container.RegisterType <ICatalogService <IBaseDTO>, CatalogService>();
     container.RegisterType <IAuditService, AuditService>();
     container.RegisterType <IEmployeeTransferService, EmployeeTransferService>();
 }
예제 #2
0
 public virtual void Start()
 {
     Context = new EFDbContext(new EmployeeContext());
     Mapper  = EmployeeMapperConfig.CreateMapper();
 }