/// <summary> /// This method is called by ASP.NET system on web application's startup. /// </summary> protected virtual void Application_Start(object sender, EventArgs e) { IocManager.Instance.IocContainer.Register(Component.For<IAssemblyFinder>().ImplementedBy<WebAssemblyFinder>()); AbpBootstrapper = new AbpBootstrapper(); AbpBootstrapper.Initialize(); }
private static AbpBootstrapper AddAbpBootstrapper <TStartupModule>(IServiceCollection services, Action <AbpBootstrapperOptions> optionsAction) where TStartupModule : AbpModule { var abpBootstrapper = AbpBootstrapper.Create <TStartupModule>(optionsAction); services.AddSingleton(abpBootstrapper); return(abpBootstrapper); }
protected void CleanUp() { if (_bootstrapper != null) { _bootstrapper.Dispose(); _bootstrapper = null; } }
protected void Configure() { if (_bootstrapper == null) { _bootstrapper = AbpBootstrapper.Create <DCServicesModule>(); _bootstrapper.Initialize(); } }
private static AbpBootstrapper AddAbpBootstrapper <TStartupModule>(IServiceCollection services, IIocManager iocManager) where TStartupModule : AbpModule { var abpBootstrapper = AbpBootstrapper.Create <TStartupModule>(iocManager); services.AddSingleton(abpBootstrapper); return(abpBootstrapper); }
public JsonAndXmlSourceMixing_Tests() { LocalIocManager.Register<ILanguageManager, LanguageManager>(); LocalIocManager.Register<ILanguageProvider, DefaultLanguageProvider>(); _bootstrapper = AbpBootstrapper.Create<MyLangModule>(LocalIocManager); _bootstrapper.Initialize(); }
public JsonAndXmlSourceMixing_Tests() { LocalIocManager.Register <ILanguageManager, LanguageManager>(); LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>(); _bootstrapper = AbpBootstrapper.Create <MyLangModule>(LocalIocManager); _bootstrapper.Initialize(); }
protected AbpStartup(IHostingEnvironment env, bool initialize = true) { AbpBootstrapper = new AbpBootstrapper(); if (initialize) { InitializeAbp(); } }
public static HostConfigurator UseAbp(this HostConfigurator configurator, AbpBootstrapper abpBootstrapper) { var log = HostLogger.Get(typeof(HostConfiguratorExtensions)); log.Info("[Topshelf.Abp] Integration Started in host."); configurator.AddConfigurator(new AbpBuilderConfigurator(abpBootstrapper)); return(configurator); }
public async Task Enable(EntityDto <long> input) { var user = _userRepository.Get(input.Id); user.IsActive = !user.IsActive; await _userRepository.UpdateAsync(user); var im_Service = AbpBootstrapper.Create <Abp.Modules.AbpModule>().IocManager.IocContainer.Resolve <IM_UserManager>(); try { if (user.IsActive) { im_Service.EnableIMUser(input.Id.ToString()); } else { //如果是部门领导 则取消部门领导负责人 var org = _workflowOrganizationUnitsRepository.GetAll().Where(ite => ite.Leader.Contains(input.Id.ToString()) || ite.ChargeLeader.Contains(input.Id.ToString())).ToList(); foreach (var o in org) { if (o.Leader.Contains(input.Id.ToString())) { var users = o.Leader.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var u in users) { if (u == "u_" + input.Id.ToString()) { users.Remove(u); break; } } o.Leader = string.Join(",", users); } if (o.ChargeLeader.Contains(input.Id.ToString())) { var users = o.ChargeLeader.Split(",", StringSplitOptions.RemoveEmptyEntries).ToList(); foreach (var u in users) { if (u == "u_" + input.Id.ToString()) { users.Remove(u); break; } } o.ChargeLeader = string.Join(",", users); } _workflowOrganizationUnitsRepository.Update(o); } CurrentUnitOfWork.SaveChanges(); im_Service.DisableIMUser(input.Id.ToString()); } } catch (Exception ex) { } }
private static void SearchClubs() { AbpBootstrapper bootstrapper = new AbpBootstrapper(); bootstrapper.Initialize(); IClubAppService clubService = bootstrapper.IocManager.Resolve <IClubAppService>(); //var result = clubService.SearchClubs(new CatchApp.Geodata.GeoPoint(46.599550, 14.270328)); }
static void AbpBootStrapper() { _bootstrapper = AbpBootstrapper.Create <CoundFlareModule>(); _bootstrapper.IocManager.IocContainer .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net() .WithConfig("log4net.config") ); _bootstrapper.Initialize(); }
public App() { this.Startup += App_Startup; Current.DispatcherUnhandledException += Current_DispatcherUnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; _bootstrapper = AbpBootstrapper.Create <IFoxtecWPFModule>(); _bootstrapper.IocManager.IocContainer.AddFacility <LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("log4net.config")); }
public App() { _bootstrapper = AbpBootstrapper.Create <ParkBoxWpfModule>(); _bootstrapper.IocManager.IocContainer.AddFacility <LoggingFacility>(x => x.UseLog4Net().WithConfig("log4net.config")); _logger = NullLogger.Instance; this.DispatcherUnhandledException += App_DispatcherUnhandledException; this.Dispatcher.UnhandledException += Dispatcher_UnhandledException; App.Current.ShutdownMode = ShutdownMode.OnExplicitShutdown; }
static void Main(string[] args) { try { using (var bootstrapper = new AbpBootstrapper()) { bootstrapper.Initialize(); using (var client = bootstrapper.IocManager.ResolveAsDisposable <MyTestClient>()) { Console.Write("Enter tenancy (demo) name: "); client.Object.TenancyName = Console.ReadLine(); if (client.Object.TenancyName.IsNullOrWhiteSpace()) { return; } Console.Write("Enter username: "******"Enter password: "******"Logging in..."); client.Object.Login(); Console.WriteLine("Getting roles..."); var roles = AsyncHelper.RunSync(() => client.Object.GetRolesAsync()); Console.WriteLine(roles.Items.Count + " roles found:"); foreach (var role in roles.Items) { Console.WriteLine("Role: Id=" + role.Id + ", DisplayName=" + role.DisplayName + ", IsDefault=" + role.IsDefault); } } } } catch (AbpRemoteCallException ex) { Console.WriteLine(ex.ToString()); } Console.WriteLine(); Console.WriteLine("Press ENTER to exit..."); Console.ReadLine(); }
public Service1() { InitializeComponent(); _bootstrapper = AbpBootstrapper.Create <AbpHangFireService>(); _bootstrapper.IocManager.IocContainer .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net() .WithConfig("log4net.config") ); }
public JsonAndXmlSourceMixing_Tests() { LocalIocManager.Register <IModuleFinder, MyTestModuleFinder>(); LocalIocManager.Register <ILanguageManager, LanguageManager>(); LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>(); _bootstrapper = new AbpBootstrapper(LocalIocManager); _bootstrapper.Initialize(); }
public static void Initialize() { if (_bootstrapper != null) { return; } _bootstrapper = new AbpBootstrapper <TTenantId, TUserId>(); _bootstrapper.Initialize(); }
protected AbpIntegratedTestBase(bool initializeAbp = true) { LocalIocManager = new IocManager(); AbpBootstrapper = AbpBootstrapper.Create <TStartupModule>(LocalIocManager); if (initializeAbp) { InitializeAbp(); } }
public static void Initialize() { if (_bootstrapper != null) { return; } _bootstrapper = new AbpBootstrapper(); _bootstrapper.Initialize(); }
public static void Initialize() { if (_bootstrapper != null) { return; } _bootstrapper = AbpBootstrapper.Create<AbpWebApiTestModule>(); _bootstrapper.Initialize(); }
static void Main(string[] args) { using (var bootstrapper = new AbpBootstrapper()) { bootstrapper.Initialize(); new SocketRemotingServer().RegisterRequestHandler(100, new RequestHandler()).Start(); Console.ReadLine(); } }
public DefaultLanguageProvider_Test() { LocalIocManager.Register <ILanguageProvider, DefaultLanguageProvider>(); var bootstrapper = AbpBootstrapper.Create <DefaultLanguageProviderLangModule>(options => { options.IocManager = LocalIocManager; }); bootstrapper.Initialize(); }
public JsonAndXmlSourceMixing_Tests() { LocalIocManager.Register<IModuleFinder, MyTestModuleFinder>(); LocalIocManager.Register<ILanguageManager, LanguageManager>(); LocalIocManager.Register<ILanguageProvider, DefaultLanguageProvider>(); _bootstrapper = new AbpBootstrapper(LocalIocManager); _bootstrapper.Initialize(); }
protected AbpIntegratedTestBase(bool initializeAbp = true) { LocalIocManager = new IocManager(); AbpBootstrapper = new AbpBootstrapper(LocalIocManager); if (initializeAbp) { InitializeAbp(); } }
protected void InitializeAbp() { LocalIocManager.Register <IAbpSession, TestAbpSession>(); PreInitialize(); AbpBootstrapper.Initialize(); AbpSession = LocalIocManager.Resolve <TestAbpSession>(); }
static void Main(string[] args) { using (var bootstrapper = new AbpBootstrapper()) { bootstrapper.Initialize(); var test = IocManager.Instance.Resolve <IUserService>(); test.GetAllUsers(); } }
public static void Initialize() { if (_bootstrapper != null) { return; } _bootstrapper = AbpBootstrapper.Create <AbpWebApiTestModule>(); _bootstrapper.Initialize(); }
private static IHostBuilder CreateHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureServices(services => { var abpBootstrapper = AbpBootstrapper.Create <SampleWorkerServiceModule>(); services.AddSingleton(abpBootstrapper); abpBootstrapper.Initialize(); services.AddHostedService <Worker>(); }) .UseCastleWindsor(IocManager.Instance.IocContainer);
public static LinqPadAbp InitModule <TModule>() where TModule : AbpModule { Console.WriteLine("Initializing Module"); var bootstrapper = AbpBootstrapper.Create <TModule>(); bootstrapper.IocManager.Register <ILinqPadContextGetter, LinqPadContextGetter>(); bootstrapper.IocManager.Register <IUnitOfWork, LinqPadUow>(DependencyLifeStyle.Transient); bootstrapper.Initialize(); return(new LinqPadAbp(bootstrapper)); }
private static void InitAbp(AbpBootstrapper bootstrapper) { bootstrapper.IocManager.IocContainer .AddFacility <LoggingFacility>(f => f.UseAbpLog4Net() .WithConfig("log4net.config") ); // 可以注入 _appConfiguration bootstrapper.Initialize(); iocManager = bootstrapper.IocManager; }
/// <summary> /// This method is called by ASP.NET system on web application's startup. /// </summary> protected virtual void Application_Start(object sender, EventArgs e) { //TODO: Use AbpBootstrapper.IocManager IocManager.Instance.IocContainer.Register(Component.For<IAssemblyFinder>().ImplementedBy<WebAssemblyFinder>()); //TODO: Use AbpBootstrapper.IocManager //TODO: Move to AbpWebModule? IocManager.Instance.IocContainer.Register(Component.For<ICurrentUnitOfWorkProvider>().ImplementedBy<HttpContextCurrentUnitOfWorkProvider>()); AbpBootstrapper = new AbpBootstrapper(); AbpBootstrapper.Initialize(); }
protected AbpStartup(IHostingEnvironment env, bool initialize = true) { //TODO: TEST XmlLocalizationSource.RootDirectoryOfApplication = env.WebRootPath; AbpBootstrapper = new AbpBootstrapper(); if (initialize) { InitializeAbp(); } }
static void Main(string[] args) { //Bootstrapping ABP system using (var bootstrapper = AbpBootstrapper.Create <MYMODULE>()) { IocManager.Instance.IocContainer.AddFacility <LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("log.config")); bootstrapper.Initialize(); Console.WriteLine("Press enter to exit..."); Console.ReadLine(); } Console.ReadLine(); }
public static void Main(string[] args) { var bootstrapper = AbpBootstrapper.Create <TestAbpRemoteEventBusModule>(); //bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f => // f.UseAbpLog4Net().WithConfig("log4net.config")); bootstrapper.Initialize(); CreateWebHostBuilder(args).Build().Run(); }
protected AbpWebApplication() { AbpBootstrapper = new AbpBootstrapper(); }
public AbpBootstraper_Tester() { _bootstrapper = new AbpBootstrapper(LocalIocManager); }
public AbpBootstraper_Tester() { _bootstrapper = AbpBootstrapper.Create<MyTestModule>(LocalIocManager); }
/// <summary> /// This method is called by ASP.NET system on web application's startup. /// </summary> protected virtual void Application_Start(object sender, EventArgs e) { AbpBootstrapper = new AbpBootstrapper(); AbpBootstrapper.Initialize(); }
private static AbpBootstrapper AddAbpBootstrapper(IServiceCollection services, IIocManager iocManager) { var abpBootstrapper = new AbpBootstrapper(iocManager); services.AddSingleton(abpBootstrapper); return abpBootstrapper; }