在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
1、简介ASP.NET Boilerplate (ABP) is an open source and well-documented application framework. It's not just a framework, it also provides a strong architectural model based on Domain Driven Design, with all the best practices in mind. 2、特点(1)模块化
包括 IOC、应用配置、应用startup&shutdown的事件
注册服务 实现模块的属性、事件及模块依赖 (2)默认仓库提供了完善的数据库操作方法
(3)工作单元
Some methods are unit of work methods by default: All MVC, Web API and ASP.NET Core MVC Controller actions.
[UnitOfWork] (4)多语言
(5)自动映射[AutoMapTo(typeof(User))] [AutoMapFrom(typeof(UserDto))] [AutoMap] (6)动态API直接将“应用服务层”的方法生成Restful API进行暴露
(7)统一返回结果效果 { "result": { ... }, "targetUrl": null, "success": true, "error": null, "unAuthorizedRequest": false, "__abp": true } 模型类 (8)...异常处理、动态JS代理等
二、ABP模块化-返回结果分析1、Startup注册ABP模块化服务// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { //此处省略其它注册服务 ... //Configure Abp and Dependency Injection return services.AddAbp<WebApiModule>(options => { //Configure Log4Net logging options.IocManager.IocContainer.AddFacility<LoggingFacility>( f => f.UseAbpLog4Net().WithConfig("log4net.config") ); }); 第一个模块化类 [DependsOn( typeof(WebCoreModule))] public class WebApiModule: AbpModule { private readonly IConfigurationRoot _appConfiguration; public WebApiModule(IWebHostEnvironment env) { _appConfiguration = AppConfigurations.Get(env.ContentRootPath, env.EnvironmentName); } 2、针对AbpModule的服务容器扩展
调用MvcOptions的扩展
3、MvcOptions的扩展添加了结果过滤器Action Result Filter
4、结果过滤器
5、包装器工厂
6、包装器
7、统一的返回结果
三、参考
https://aspnetboilerplate.com/Pages/Documents/Introduction
|
请发表评论