Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch dev with rel-5.0 #10416

Merged
merged 2 commits into from
Oct 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/en/Migration-Guides/Abp-5-0-Blazor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ABP Blazor UI v4.x to v5.0 Migration Guide

This document is for the ABP MVC / Razor Pages UI. See also [the main migration guide](Abp-5_0.md).

## Upgrading to the latest Blazorise

ABP 5.0 uses the latest version of the [Blazorise](https://blazorise.com/) library. Please upgrade the Blazorise NuGet packages in your solution.
7 changes: 7 additions & 0 deletions docs/en/Migration-Guides/Abp-5-0-MVC.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ABP MVC / Razor Pages UI v4.x to v5.0 Migration Guide

This document is for the ABP MVC / Razor Pages UI. See also [the main migration guide](Abp-5_0.md).

## Use install-libs by default

Removed the Gulp dependency from the MVC / Razor Pages UI projects in favor of `abp install-libs` command ([see](https://docs.abp.io/en/abp/5.0/UI/AspNetCore/Client-Side-Package-Management#install-libs-command)) of the ABP CLI. You should run this command whenever you change/upgrade your client-side package dependencies via `package.json`.
71 changes: 51 additions & 20 deletions docs/en/Migration-Guides/Abp-5_0.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,51 @@
# ABP Framework v4.x to v5.0 Migration Guide

## IdentityUser
This document is a guide for upgrading ABP 4.x solutions to ABP 5.0. Please read them all since 5.0 has some important breaking changes.

`IsActive <bool>` property is added to the `IdentityUser`. This flag will be checked during the authentication of the users. See the related [PR](https://github.com/abpframework/abp/pull/10185).
**After the migration, set this property to `true` for the existing users: `UPDATE AbpUsers SET IsActive=1`**
## .NET 6.0

For EFCore you can set `defaultValue` to `true` in the migration class:
(This will add the column with `true` value for the existing records.)
ABP 5.0 runs on .NET 6.0. So, please upgrade your solution to .NET 6.0 if you want to use ABP 5.0. You can see [Microsoft's migration guide](https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60).

## Bootstrap 5

ABP 5.0 uses the Bootstrap 5 as the fundamental HTML/CSS framework. We've migrated all the UI themes, tag helpers, UI components and the pages of the pre-built application modules. You may need to update your own pages by following the [Bootstrap's migration guide](https://getbootstrap.com/docs/5.0/migration/).

## ABP Framework

This section contains breaking changes in the ABP Framework.

### MongoDB

ABP Framework will serialize the datetime based on [AbpClockOptions](https://docs.abp.io/en/abp/latest/Timing#clock-options) starting from ABP v5.0. It was saving `DateTime` values as UTC in MongoDB. Check out [MongoDB Datetime Serialization Options](https://mongodb.github.io/mongo-csharp-driver/2.13/reference/bson/mapping/#datetime-serialization-options).

If you want to revert back this feature, set `UseAbpClockHandleDateTime = false` in `AbpMongoDbOptions`:

```cs
services.Configure<AbpMongoDbOptions>(x => x.UseAbpClockHandleDateTime = false);
```

### Removed Obsolete APIs

* `IRepository` doesn't inherit from `IQueryable` anymore. It was [made obsolete in 4.2](https://docs.abp.io/en/abp/latest/Migration-Guides/Abp-4_2#irepository-getqueryableasync).

## UI Providers

* [Angular UI 4.x to 5.0 Migration Guide](Abp-5_0-Angular.md)
* [ASP.NET Core MVC / Razor Pages UI 4.x to 5.0 Migration Guide]()
* [Blazor UI 4.x to 5.0 Migration Guide](Abp-5-0-Blazor.md)

## Modules

This section contains breaking and important changes in the application modules.

### Identity

An `IsActive` (`bool`) property is added to the `IdentityUser` entity. This flag will be checked during the authentication of the users. EF Core developers need to add a new database migration and update their databases.

**After the database migration, set this property to `true` for the existing users: `UPDATE AbpUsers SET IsActive=1`**. Otherwise, none of the users can login to the application.

Alternatively, you can set `defaultValue` to `true` in the migration class (after adding the migration).
This will add the column with `true` value for the existing records.

```cs
public partial class AddIsActiveToIdentityUser : Migration
Expand All @@ -30,22 +69,14 @@ public partial class AddIsActiveToIdentityUser : Migration
}
```

For document base databases like MongoDB, you need to manually update the `IsActive` field for the existing user records.

## MongoDB

ABP Framework will serialize the datetime based on [AbpClockOptions](https://docs.abp.io/en/abp/latest/Timing#clock-options) starting from ABP v5.0. It was saving `DateTime` values as UTC in MongoDB. Check out [MongoDB Datetime Serialization Options](https://mongodb.github.io/mongo-csharp-driver/2.13/reference/bson/mapping/#datetime-serialization-options).

To revert back this feature, set `UseAbpClockHandleDateTime = false` in `AbpMongoDbOptions`:

```cs
services.Configure<AbpMongoDbOptions>(x => x.UseAbpClockHandleDateTime = false);
```
For MongoDB, you need to manually update the `IsActive` field for the existing users.

## IApiScopeRepository
### IdentityServer

`GetByNameAsync` method renamed as `FindByNameAsync`.
`IApiScopeRepository.GetByNameAsync` method renamed as `FindByNameAsync`.

## Angular UI
## See Also

See the [Angular UI 5.0 Migration Guide](Abp-5_0-Angular.md).
* [Angular UI 4.x to 5.0 Migration Guide](Abp-5_0-Angular.md)
* [ASP.NET Core MVC / Razor Pages UI 4.x to 5.0 Migration Guide]()
* [Blazor UI 4.x to 5.0 Migration Guide](Abp-5-0-Blazor.md)