public static AppBootProgram RegisterAutoMappe(this AppBootProgram app) { MapperExtensions.LazyMapper = new Lazy <IMapper>(() => new AutoMapperMapper()); if (!app.MapperCollection.Any()) { return(app); } MapperExtensions.Instance.Initialize(app.MapperCollection); return(app); }
public static AppBootProgram RegisterAutoMappe(this AppBootProgram app) { MapperProvider.SetMapper(new AutoMapperMapper()); if (!app.MapperCollection.Any()) { return(app); } MapperProvider.Current.Initialize(app.MapperCollection); return(app); }
public static AppBootProgram RegisterAutofac(this AppBootProgram app, Type httpApplicationType) { var builder = new ContainerBuilder(); builder.RegisterFilterProvider(); builder.Populate(app.ServiceCollection); builder.RegisterControllers(httpApplicationType.Assembly) .PropertiesAutowired(); var container = builder.Build(); var resolver = new AutofacDependencyResolver(container); DependencyResolver.SetResolver(resolver); return(app); }
public static AppBootProgram RegisterAutofac(this AppBootProgram app, params Assembly[] controllerAssemblies) { RegisterAutofacInternal(app.ServiceCollection, controllerAssemblies); return(app); }
public static AppBootProgram RegisterAutofac(this AppBootProgram app, Type httpApplicationType) { RegisterAutofacInternal(app.ServiceCollection, httpApplicationType.Assembly); return(app); }
public static AppBootProgram RegisterIdentity(this AppBootProgram app, Action <IServiceCollection> action) { action(app.ServiceCollection); return(app); }