ASP.NET Boilerplate v0.10.0 Has Been Released

ASP.NET Boilerplate v0.10.0 Has Been Released

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.

Highlights

ASP.NET Core Integration

ASP.NET Core Integration is finalized and released as Abp.AspNetCore package. Also, released Abp.AspNetCore.TestBase package to make integration testing easier.

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.

AbpIntegratedTestBase Class

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.

Breaking Changes

  • 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.

Conclusion

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.

Also, revised all documentation fo reflect latest changes and upgraded startup templates.

Road Map

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.

We are also working on a simple startup template to start applications with ASP.NET Core. Planned to release it before v0.11. Follow us on twitter to be informed when it’s released.

7 Comments
  • daws
    Reply
    Posted at 19:27, July 18, 2016

    awesome work, like always :)

  • Natiki
    Reply
    Posted at 16:51, July 19, 2016

    Hi Halil,

    “ABP checks ModelState.IsValid for all MVC and Web API actions anymore.”

    Can you explain that one a little bit more please? I may have missed it in the documentation somewhere?

      • Natiki
        Reply
        Posted at 05:11, July 20, 2016

        Thanks. I will look at this new pattern in the samples.

  • Posted at 18:50, September 13, 2016

    Hi,

    I think you have to add this too : IDoubleWayDto

Post a Comment

Comment
Name
Email
Website