diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs index d1ef8b6d93..c9e8f23b1f 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs @@ -282,9 +282,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task OpenCreateModalAsync() { - await OnOpeningCreateModalAsync(); - - CreateValidationsRef.ClearAll(); + CreateValidationsRef?.ClearAll(); await CheckCreatePolicyAsync(); @@ -297,11 +295,6 @@ namespace Volo.Abp.BlazoriseUI CreateModal.Show(); } - protected virtual Task OnOpeningCreateModalAsync() - { - return Task.CompletedTask; - } - protected virtual Task CloseCreateModalAsync() { CreateModal.Hide(); @@ -310,9 +303,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task OpenEditModalAsync(TKey id) { - await OnOpeningEditModalAsync(id); - - EditValidationsRef.ClearAll(); + EditValidationsRef?.ClearAll(); await CheckUpdatePolicyAsync(); @@ -326,11 +317,6 @@ namespace Volo.Abp.BlazoriseUI EditModal.Show(); } - protected virtual Task OnOpeningEditModalAsync(TKey id) - { - return Task.CompletedTask; - } - protected virtual TUpdateViewModel MapToEditingEntity(TGetOutputDto entityDto) { return ObjectMapper.Map(entityDto); @@ -364,7 +350,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task CreateEntityAsync() { - if (CreateValidationsRef.ValidateAll()) + if (CreateValidationsRef?.ValidateAll() ?? false) { await OnCreatingEntityAsync(); @@ -391,7 +377,7 @@ namespace Volo.Abp.BlazoriseUI protected virtual async Task UpdateEntityAsync() { - if (EditValidationsRef.ValidateAll()) + if (EditValidationsRef?.ValidateAll() ?? false) { await OnUpdatingEntityAsync(); diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs index ad93eace86..bd1ac19814 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor.cs @@ -48,7 +48,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity Roles = (await AppService.GetAssignableRolesAsync()).Items; } - protected override async Task OnOpeningCreateModalAsync() + protected override Task OnOpeningCreateModalAsync() { CreateModalSelectedTab = DefaultSelectedTab; @@ -58,7 +58,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity IsAssigned = x.IsDefault }).ToArray(); - await base.OnOpeningCreateModalAsync(); + return base.OpenCreateModalAsync(); } protected override Task OnCreatingEntityAsync() @@ -81,7 +81,7 @@ namespace Volo.Abp.Identity.Blazor.Pages.Identity IsAssigned = userRoleNames.Contains(x.Name) }).ToArray(); - await base.OnOpeningEditModalAsync(id); + await base.OpenEditModalAsync(id); } protected override Task OnUpdatingEntityAsync()