We are very glad to announce that we have released ASP.NET Boilerplate application framework v0.10.0.
This release is focused on ASP.NET Core integration. Also, aligned ASP.NET Core, MVC and Web API behaviours as much as possible, made startup performance optimization, fixed some bugs and made many enhancements.
There are important BREAKING CHANGES for existing applications. But all they are easy to fix. We will cover them all in this post. Please read this post while upgrading your project.
ASP.NET Core Integration
We are currently preparing a startup template. We will announce it on our twitter account when it’s finished. We will also prepare some articles. But we believe it will be very easy for existing ABP developers to start with it.
Better ASP.NET MVC and ASP.NET Web API Integration
ABP is focused to handle cross cutting concerns (validation, authorization, unit of work, audit logging…) in application layer. MVC and Web API controllers had some differences and missing points. We made some changes to better integrate to that layers:
- Unit Of Work: ASP.NET MVC and Web API Controller actions are unit of work by default from v0.10. No need to use [UnitOfWork] attribute and virtual keyword for actions. You can configure this default behaviour from startup configuration. See documents.
- Auditing: Implemented auditing for regular Web API Controllers and enabled by default.
- Validation: Validation logic aligned with application services for MVC and Web API. We can now use ICustomValidate and IShouldNormalize interfaces for DTOs/ViewModels. Also, it automatically checkes for ModelState.IsValid.
These changes may effect your application, especially the unit of work change. You can either revise your actions according to that change or disable it from startup configuration to keep old behaviour.
Loading Dynamic PlugIn Modules
We added a simple dynamic plugin module loading feature to load modules in assemblies located under a folder. But actually it’s more powerful, you can create custom dynamic module sources by implementing IPlugInSource interface. See documentation.
Bootstrapping ABP and Startup Optimization
ABP was searching all dlls to find module definition classes (derived from AbpModule). This was relatively slow. Now, it starts from a ‘startup module’ and following dependencies to find all modules in the application. So, we should explicitly define dependencies (using DependsOn attribute) to modules. Otherwise, they will not be loaded.
It gets startup module as generic argument on AbpBootstrapper.Create method. See #1167 to know how to fix it for existing applications.
According to AbpBootstrapper changes;
- Removed AddModules method and made AbpIntegratedTestBase generic to accept startup module as generic argument.
- It’s required to add DependsOn attribute for AbpTestBaseModule to your test module definition.
Better HTTP Status Codes on Exceptions
Previously, ABP was returning 200 (OK) HTTP status code for exceptions and sending exception information to the client. Client was handling it and showing error message. From v0.10, ABP will return the following status codes on exceptions:
- 401 for unauthentiaced exception.
- 403 for unauthorized exception.
- 500 for all other exceptions.
And client code also handles these exceptions and shows different types of messages.
- IValidate interface is removed. Also, IInputDto, IOutputDto, IDoubleWayDto and IDto will be removed. See #1199 and #1200 for more information.
- ABP returns different HTTP status codes (401, 403, 500) on exceptions (see above).
- MVC Controller and Web API Actions are Unit Of Work by default from now (it’s configurable).
- ABP checks ModelState.IsValid for all MVC and Web API actions anymore.
- Replaced AbpBootstrapper constructor with static methods on AbpBootstrapper. It gets startup module type as generic argument. See the section above.
See https://github.com/aspnetboilerplate/aspnetboilerplate/milestone/46?closed=1 for all changes in v0.10.
This release was 2 major targets:
- It contains finalized ASP.NET Core integration (Notice that this is not based on .NET Core (yet). It’s based on .NET Framework 4.6.1. So, it’s not cross platform).
- Stabilizing the framework by better handling HTTP standards, better integrating to MVC and Web API and better startup performance.
v0.11 will focus on Entity Framework Core integration. While current Abp.EntityFrameworkCore package is properly integrated to UOW and repository systems, it has some missing points like transaction management and multiple dbcontext support. It will also include some other features and enhancements. See the milestone on Github.