你的位置:首页 > 软件开发 > ASP.net > Abp Application级别的生命周期

Abp Application级别的生命周期

发布时间:2015-11-26 13:00:27
本篇级别: 中高级篇,假设各位知道Abp是什么, Abp里面的基本的概念及用法 AbpWebApplication AbpWebApplication是需要我们的Global.cs里面的HttpApplication继承他, 初始化分两个阶段 构造方法AbpWebApplicat ...

本篇级别: 中高级篇,假设各位知道Abp是什么, Abp里面的基本的概念及用法

AbpWebApplication

AbpWebApplication是需要我们的Global.cs里面的HttpApplication继承他, 初始化分两个阶段

构造方法AbpWebApplication()

在这个方法里面,做了非常重要但是很简单的事, 通过 AbpBootstrapper类库,间接实例化了IocManager.Instance, 并且注册了IocManager,IIlocManager,IIocRegistrar, IIocResolver做了注册,

也就是这一步完成之后,IocManager.Instance.Reslove只能解析上面的四个类型, 其他类型到目前为止,还一个都没有注册.

 

Application_Start(object sender, EventArgs e)方法

a. 注册了IAssemblyFinder, 关联到了WebAssemblyFinder类库, 猜主要是用来寻找相关类库, 看其代码主要是获取当前bin目录下的所有dll组件,并跟当前已加载的 Assembly做比较,最后返回当前程序已加载的dll, 忽略未加载的.

b. AbpBootstrapper初始化,

b.1 IocManager.IocContainer.Install(new AbpCoreInstaller());
Component.For<IUnitOfWorkDefaultOptions, UnitOfWorkDefaultOptions>().ImplementedBy<UnitOfWorkDefaultOptions>().LifestyleSingleton(),        Component.For<INavigationConfiguration, NavigationConfiguration>().ImplementedBy<NavigationConfiguration>().LifestyleSingleton(),        Component.For<ILocalizationConfiguration, LocalizationConfiguration>().ImplementedBy<LocalizationConfiguration>().LifestyleSingleton(),        Component.For<IAuthorizationConfiguration, AuthorizationConfiguration>().ImplementedBy<AuthorizationConfiguration>().LifestyleSingleton(),        Component.For<IFeatureConfiguration, FeatureConfiguration>().ImplementedBy<FeatureConfiguration>().LifestyleSingleton(),        Component.For<ISettingsConfiguration, SettingsConfiguration>().ImplementedBy<SettingsConfiguration>().LifestyleSingleton(),        Component.For<IModuleConfigurations, ModuleConfigurations>().ImplementedBy<ModuleConfigurations>().LifestyleSingleton(),        Component.For<IEventBusConfiguration, EventBusConfiguration>().ImplementedBy<EventBusConfiguration>().LifestyleSingleton(),        Component.For<IMultiTenancyConfig, MultiTenancyConfig>().ImplementedBy<MultiTenancyConfig>().LifestyleSingleton(),        Component.For<ICachingConfiguration, CachingConfiguration>().ImplementedBy<CachingConfiguration>().LifestyleSingleton(),        Component.For<IAuditingConfiguration, AuditingConfiguration>().ImplementedBy<AuditingConfiguration>().LifestyleSingleton(),        Component.For<IAbpStartupConfiguration, AbpStartupConfiguration>().ImplementedBy<AbpStartupConfiguration>().LifestyleSingleton(),        Component.For<ITypeFinder>().ImplementedBy<TypeFinder>().LifestyleSingleton(),        Component.For<IModuleFinder>().ImplementedBy<DefaultModuleFinder>().LifestyleTransient(),        Component.For<IAbpModuleManager>().ImplementedBy<AbpModuleManager>().LifestyleSingleton(),        Component.For<ILocalizationManager, LocalizationManager>().ImplementedBy<LocalizationManager>().LifestyleSingleton()

 

海外公司注册、海外银行开户、跨境平台代入驻、VAT、EPR等知识和在线办理:https://www.xlkjsw.com

原标题:Abp Application级别的生命周期

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

可能感兴趣文章

我的浏览记录