3 weeks ago, 212 views
3 weeks ago, 168 views
4 weeks ago, 2479 views
1 month ago, 733 views
1 month ago, 1189 views
Today, we are excited to release the ABP Framework and the ABP Commercial version 5.0 RC (Release Candidate). This blog post introduces the new features and important changes in this new version.
The planned release date for the 5.0.0 Stable version is December 14, 2021.
Please try this version and provide feedback for a more stable ABP version 5.0! Thank you all.
follow the steps below to try the version 5.0.0 RC today;
5.0.0-rc.1
using a command line terminal:dotnet tool update Volo.Abp.Cli -g --version 5.0.0-rc.1
or install if you haven't installed before:
dotnet tool install Volo.Abp.Cli -g --version 5.0.0-rc.1
--preview
option:abp new BookStore --preview
See the ABP CLI documentation for all the available options.
You can also use the Direct Download tab on the Get Started page by selecting the Preview checkbox.
You can use any IDE that supports .NET 6.0, like Visual Studio 2022.
This is a major version and there are some breaking changes and upgrade steps. Here, a list of important breaking changes in this version:
IRepository
doesn't inherit from IQueryable
anymore. It was already made obsolete in 4.2.abp install-libs
command of the ABP CLI.EntityCreatingEventData
, EntityUpdatingEventData
, EntityDeletingEventData
and EntityChangingEventData
classes. See #9897.Please see the migration document for all the details. You can also see all the closed issues and pull requests.
In this section, I will introduce some major features released with this version.
Dynamic C# (see) and JavaScript (see) client proxy system is one of the most loved features of the ABP Framework. It generates the proxy code on runtime and makes client-to-server calls a breeze. With ABP 5.0, we are providing an alternative approach: You can generate the client proxy code on development-time.
Development-time client proxy generation has a performance advantage since it doesn't need to obtain the HTTP API definition on runtime. It also makes it easier to consume a (micro)service behind an API Gateway. With dynamic proxies, we should return a combined HTTP API definition from the API Gateway and need to add HTTP API layers of the microservices to the gateway. Static proxies removes this requirement. One disadvantage is that you should re-generate the client proxy code whenever you change your API endpoint definition. Yes, software development always has tradeoffs :)
Working with static client proxy generation is simple with the ABP CLI. You first need to run the server application, open a command-line terminal, locate to the root folder of your client application, then run the generate-proxy
command of the ABP CLI.
C# client proxies are useful to consume APIs from Blazor WebAssembly applications. It is also useful for microservice to microservice HTTP API calls. Notice that the client application need to have a reference to the application service contracts (typically, the .Application.Contracts
project in your solution) in order to consume the services.
Example usage:
abp generate-proxy -t csharp -u https://localhost:44305
-t
indicates the client type, C# here. -u
is the URL of the server application. It creates the proxies for the application (the app module) by default. You can specify the module name as -m <module-name>
if you are building a modular system. The following figure shows the generated files:
The next step is to enable the static proxy system for your application (or module) using the AddStaticHttpClientProxies
extension method:
context.Services.AddStaticHttpClientProxies(
typeof(MyApplicationContractsModule).Assembly
);
You can then inject and use the application service interfaces of these proxies. The usage is same of the dynamic C# client proxies.
When you use static proxies for a module / application, you don't need to dynamic proxies. Find and remove the context.Services.AddHttpClientProxies(...)
in your solution (typically in the *.HttpApi.Client
project).
JavaScript proxies are useful to consume APIs from MVC / Razor Pages UI. It works on JQuery AJAX API, just like the dynamic JavaScript proxies.
Example usage:
abp generate-proxy -t js -u https://localhost:44305
The following figure shows the generated file:
Then you can consume the server-side APIs from your JavaScript code just like the dynamic JavaScript proxies.
Angular developers knows that the generate-proxy command was already available in ABP's previous versions to create client-side proxy services in the Angular UI. The same functionality continues to be available and already documented here.
Example usage:
abp generate-proxy -t ng -u https://localhost:44305
This was one of the most awaited features by distributed software developers.
The transactional outbox pattern is used to publishing distributed events within the same transaction that manipulates the application database. Distributed events are saved into the database inside the same transaction with your data changes, then sent to the message broker (like RabbitMQ or Kafka) by a separate background worker with a re-try system. In this way, it ensures the consistency between your database state and the published events.
The transactional inbox pattern, on the other hand, saves incoming events into database first, then executes the event handler in a transactional manner and removes the event from the inbox queue in the same transaction. It also ensures that the event is only executed one time by keeping the processed messages for a while and discarding the duplicate events received from the message broker.
Enabling the inbox and outbox patterns requires a few manual steps for your application. We've created a simple console application example, but I will also explain all the steps here.
First of all, you need to have EF Core or MongoDB installed into your solution. It should be already installed if you'd created a solution from the ABP startup template.
For the outbox & inbox functionality, ABP depends on DistributedLock.Core library which provides a distributed locking system for concurrency control in a distributed environment. There are many distributed lock providers, including Redis, SqlServer and ZooKeeper. You can use the one you like. Here, I will show the Redis provider.
Add DistributedLock.Redis NuGet package to your project, then add the following code into the ConfigureService method of your ABP module class:
context.Services.AddSingleton<IDistributedLockProvider>(sp =>
{
var connection = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
return new RedisDistributedSynchronizationProvider(connection.GetDatabase());
});
We are getting the Redis configuration from the appsettings.json
file, so add the following lines to your appsettings.json
file:
"Redis": {
"Configuration": "127.0.0.1"
}
You can change the IP or customize the configuration based on your environment.
Open your DbContext
class, implement the IHasEventInbox
and the IHasEventOutbox
interfaces. You should end up by adding two DbSet
properties into your DbContext
class:
public DbSet<IncomingEventRecord> IncomingEvents { get; set; }
public DbSet<OutgoingEventRecord> OutgoingEvents { get; set; }
Add the following lines inside the OnModelCreating
method of your DbContext
class:
builder.ConfigureEventInbox();
builder.ConfigureEventOutbox();
It is similar for MongoDB; implement the IHasEventInbox
and the IHasEventOutbox
interfaces. There is no Configure...
method for MongoDB.
Now, we've added inbox/outbox related tables to our database schema. Now, for EF Core, use the standard Add-Migration
and Update-Database
commands to apply changes into your database (you can skip this step for MongoDB). If you want to use the command-line terminal, run the following commands in the root directory of the database integration project:
dotnet ef migrations add "Added_Event_Boxes"
dotnet ef database update
As the last step, write the following configuration code inside the ConfigureServices
method of your module class:
Configure<AbpDistributedEventBusOptions>(options =>
{
options.Outboxes.Configure(config =>
{
config.UseDbContext<YourDbContext>();
});
options.Inboxes.Configure(config =>
{
config.UseDbContext<YourDbContext>();
});
});
Replace YourDbContext
with your DbContext
class.
That's all. You can continue to publishing and consuming events just as before. See the distributed event bus documentation if you don't know how to use it.
The previous feature (outbox & inbox) solves the transactional event publishing problem for distributed systems. This feature, publishing events in transaction, solves the problem of executing event handlers in the same transaction that the events are published in for non-distributed applications. With 5.0, all events (local or distributed) are handled in the same transaction. If any handler fails, the transaction is rolled back. If you don't want that, you should use try/catch and ignore the exception inside your event handler.
Remember that if you don't install a real distributed event provider (like RabbitMQ or Kafka), the distributed events are actually executed in-process, just like the local events. So, with this development, all the events become transactional, even if your system is distributed or not.
No action needed to take. It will just work by default. There is a deprecation note related to this change (some pre-defined events will be removed in the next major version since they are not needed anymore)
The Identity module has a new feature to make a user active or inactive. Inactive users can not login to the system. In this way, you can disable a user account without deleting it. An Active checkbox is added to the user create/edit dialog to control it on the UI:
EF Core developers should add a new database migration since this brings a new field to the AbpUsers
table.
If you're building a multi-tenant application, it is now possible to override email sending settings per tenant. To make this possible, you should first enable that feature to the tenant you want, by clicking the Actions -> Features for the tenant.
Enable the feature using the checkbox as shown in the following modal:
Then the tenant admin can open the email settings page under the Administration -> Settings menu (on development environment, logout, switch to the tenant and re-login with the tenant admin):
ABP allows to use Hangfire as the background job manager when you install the integration package as documented. Hangfire's dashboard is used to monitor and control the background job queues. Here, a screenshot from the dashboard:
Hangfire's dashboard is not authorized by default, so any user can navigate to the /hangfire
URL and see/control the jobs. With the ABP version 5.0, we've added a built-in authorization implementation for the Hangfire dashboard. Instead of app.UseHangfireDashboard();
, you can use the following middleware configuration:
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AsyncAuthorization = new[] { new AbpHangfireAuthorizationFilter() }
});
In this way, only the authenticated users can see the dashboard. However, we suggest to set a permission name, so only the users with that permission can see the dashboard:
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
AsyncAuthorization = new[] {
new AbpHangfireAuthorizationFilter("MyPermissionName")
}
});
You can define the permission (MyPermissionName
in this example) using the standard permission system.
ABP provides an AbpController
class that you can inherit your MVC controllers from. It provides some pre-injected services to simplify your controllers. With v5.0, we are adding a second base controller class, AbpControllerBase
, which is more proper to create API controllers (without view features). It is suggested to inherit from the AbpControllerBase
class to create API controllers, instead of the AbpController
class.
Example:
[Route("api/products")]
public class ProductController : AbpControllerBase
{
// TODO: ...
}
Beginning from the version 5.0, ABP automatically sets the TenantId
for you when you create a new entity object (that implements the IMultiTenant
interface). It is done in the constructor of the base Entity
class (all other base entity and aggregate root classes are derived from the Entity
class). The TenantId
is set from the current value of the ICurrentTenant.Id
property.
Previously, it was a responsibility of the developer to set TenantId
for new entities. Now, ABP takes care of it. You only may need to set it if you want to set id of a tenant other than the current tenant.
This can be a breaking change in rare cases (for example, if you create host side entities from a tenant context and do not explicitly set host entity's TenantId
to null
).
As the core ABP development team, we've decided to organize monthly live meetings with the ABP community. The first live meeting will be at December 16, 2021, 17:00 (UTC) on YouTube. ABP core team members will present some of the new features coming with ABP 5.0.
Join this event on the Kommunity platform: https://kommunity.com/volosoft/events/abp-community-talks-4afca9c9
You can also subscribe to the Volosoft channel for reminders for further ABP events and videos.
It was great for us to be invited to Microsoft's ASP.NET Community Weekly Standup show, at September 28. There was a very high attention and that made us very happy. Thanks to the ABP Community and all the watchers :) If you've missed the talk, you can watch it here.
I am currently authoring the first official book for the ABP Framework and it is on pre-sale on Amazon now.
This books is a complete guide to start working with the ABP Framework, explore the ABP features and concepts. It also contains chapters for DDD, modular application development and multi-tenancy to learn and practically work with the ABP architecture to build maintainable software solutions and create SaaS applications. The book will be based on ABP 5.0 and published in the beginning of 2022. You can pre-order now!
Here, some of the latest posts added to the ABP community:
Thanks to the ABP Community for all the contents they have published. You can also post your ABP and .NET related (text or video) contents to the ABP Community.
The ABP version 5.0 is coming with important changes (like .NET 6 and Bootstrap 5) and features. In this blog post, I summarized the news about that new version. Please try it and provide feedback by opening issues on the GitHub repository. Thank you all!
Awesome article, thank you so much for your efforts.
You're welcome :)
ty
ty
ABP Studio (beta) is generally available to everyone and ready for download. Continue Reading
Some big changes and improvements are coming to the ABP.IO Platform soon Continue Reading
Introducing the ABP.IO Platform version 7.1! Continue Reading
Introducing the ABP.IO Platform version 5.2.0! Continue Reading
Introducing the new features and changes coming with ABP Framework and ABP Commercial version 5.2. Continue Reading
Introducing the new features and changes coming with ABP Framework and ABP Commercial version 5.1. Continue Reading
Introducing the ABP 5.0 release. Continue Reading
ABP Framework and ABP Commercial 4.4 versions have been released. Continue Reading
This post covers the new features and changes coming with the ABP.IO platform version 4.4. Continue Reading
Introducing the ABP.IO Platform version 4.3.0! Continue Reading
Introducing the ABP Commercial v4.3 RC and the new features coming with this version Continue Reading
Introducing the ABP v4.3 RC and the new features coming with this version Continue Reading
ABP Framework and ABP Commercial 4.2 versions have been released today. Continue Reading
This post covers the new features and changes coming with the ABP.IO platform 4.2 version. Continue Reading
ABP Framework and ABP Commercial 4.1 versions have been released. Continue Reading
Released ABP.IO Platform v4.1 RC. Some new features: Module Entity Extensions, Blazor UI Improvements, Spanish Language Translation etc. Learn more... Continue Reading
Released ABP.IO Platform v4.0 Final. Some new features: Migrated to .NET 5.0, Stable Blazor UI, Identity Server 4 Upgrade, Moved to System.Text.Jso... Continue Reading
Released ABP.IO Platform v4.0 RC. Some new features: Migrated to .NET 5.0, Stable Blazor UI, Identity Server 4 Upgrade, Moved to System.Text.Json, ... Continue Reading
Released ABP v3.3. Some new features: New modules & features for the Blazor UI, Automatic Validation for AntiForgery Token for HTTP APIs, Rebus Int... Continue Reading
Released ABP v3.3 RC. Some new features: New modules & features for the Blazor UI, Automatic Validation for AntiForgery Token for HTTP APIs, Rebus ... Continue Reading
Released ABP v3.2 final. Some new features: The Blazor UI, MongoDB ACID Transactions, Kafka Integration for the Distributed Event Bus etc. Learn mo... Continue Reading
Released ABP v3.2 RC. Some new features: The Blazor UI, MongoDB ACID Transactions, Kafka Integration for the Distributed Event Bus etc. Learn more ... Continue Reading
ABP Framework has introduced the new Angular Service Proxy Generation system with the version 3.1. This post introduces the service proxy generatio... Continue Reading
Released ABP v3.1 final. Some new features: Angular Service Proxies, Authorization Code Flow for the Angular UI, Global Feature System etc. Learn m... Continue Reading
Released ABP v3.1 RC. Some new features: Angular Service Proxies, Authorization Code Flow for the Angular UI, Global Feature System etc. Learn more... Continue Reading
Released ABP v3.0. Some new features: Angular 10, The Oracle Integration Package, Azure BLOB Storage Provider etc. Learn more about what's new with... Continue Reading
Released ABP v2.9.0. Some new features: Organization Units System, Blob Storing Package, EF Core Oracle Integration Package, Chat Module Angular UI... Continue Reading
Released ABP Framework and ABP Commercial v2.8. Some new features: SignalR Integration Package, RTL Support for the MVC UI, New Lepton Theme Styles... Continue Reading
Released ABP Framework v2.7. Some new features: Object Extending System, Text Templating Package, Subscribing to the Exceptions etc. Learn more abo... Continue Reading
Released ABP Framework v2.3. Some new features: React Native Mobile App, Angular TypeScript Proxy Generator, CRUD app service etc. See the GitHub m... Continue Reading
Released ABP Framework v2.0 and ABP Commercial. See the release notes for changes. Create a demo to see application startup template of ABP Commerc... Continue Reading
Released the first stable ABP v1.0, after ~3 years of continuous development! Start playing with the new ABP framework now. See the GitHub mileston... Continue Reading
Released ABP v0.21 with no new feature. The release is just upgrade to the stable AspNet Core 3.0. Check v0.20 release notes for new features, and ... Continue Reading
Released ABP v0.19 with 90+ issues resolved and 650+ commits pushed. Some new features: Angular UI, Widget System. See the roadmap for all upcomings. Continue Reading
Released ABP v0.18 with 80+ issues resolved and 550+ commits pushed. Changes: ABP CLI command line tool, and new startup templates. See the roadmap... Continue Reading
See microservice solution demo documentation for a detailed explanation of the solution. It aims to demonstrate a simple yet complete microservice ... Continue Reading