diff --git a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs index f1563947c0..35b436565d 100644 --- a/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs +++ b/framework/src/Volo.Abp.BlazoriseUI/AbpCrudPageBase.cs @@ -294,8 +294,6 @@ namespace Volo.Abp.BlazoriseUI await InvokeAsync(() => StateHasChanged()); CreateModal.Show(); - - await OnOpeningCreateModalAsync(); } protected virtual Task OnOpeningCreateModalAsync() @@ -303,11 +301,6 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - protected virtual Task OnOpenedCreateModalAsync() - { - return Task.CompletedTask; - } - protected virtual Task CloseCreateModalAsync() { CreateModal.Hide(); @@ -330,8 +323,6 @@ namespace Volo.Abp.BlazoriseUI await InvokeAsync(() => StateHasChanged()); EditModal.Show(); - - await OnOpenedEditModalAsync(id); } protected virtual Task OnOpeningEditModalAsync(TKey id) @@ -339,11 +330,6 @@ namespace Volo.Abp.BlazoriseUI return Task.CompletedTask; } - protected virtual Task OnOpenedEditModalAsync(TKey id) - { - return Task.CompletedTask; - } - protected virtual TUpdateViewModel MapToEditingEntity(TGetOutputDto entityDto) { return ObjectMapper.Map(entityDto); diff --git a/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs b/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs index a173c2a95d..a3fd87188f 100644 --- a/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs +++ b/framework/src/Volo.Abp.Core/System/AbpObjectExtensions.cs @@ -106,62 +106,5 @@ namespace System return obj; } - - /// - /// Resets all fields of a given object to their default values. - /// - /// Type of the object. - /// An object - /// Alternative custom method to reset the values. - /// Returns the original object. - public static T ResetState(this T obj, Action customReset = null) - { - if (customReset != null) - { - customReset(obj); - } - else - { - var properties = typeof(T).GetProperties(); - - foreach (var property in properties) - { - if (!property.CanWrite) - { - continue; - } - - property.SetValue(obj, null); - } - } - - return obj; - } - - /// - /// Applies all fields of a given object from it's counterpart. - /// - /// Type of the object. - /// An object. - /// An object from which we copy the values. - /// Returns the original object. - public static T ApplyState(this T obj, T other) - { - // This code is not production ready and it should be removed once - // the proper validation in Blazorise is done! - var properties = typeof(T).GetProperties(); - - foreach (var property in properties) - { - if (!property.CanWrite) - { - continue; - } - - property.SetValue(obj, typeof(T).GetProperty(property.Name).GetValue(other)); - } - - return obj; - } } } diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/AbpIdentityBlazorMessageLocalizerExtensions.cs b/modules/identity/src/Volo.Abp.Identity.Blazor/AbpIdentityBlazorMessageLocalizerExtensions.cs index 18a6242bab..72328eb86d 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/AbpIdentityBlazorMessageLocalizerExtensions.cs +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/AbpIdentityBlazorMessageLocalizerExtensions.cs @@ -7,17 +7,17 @@ namespace Volo.Abp.Identity.Blazor { public static class AbpIdentityBlazorMessageLocalizerExtensions { - public static string Localize(this IStringLocalizer stringLocalizer, string format, IEnumerable arguments) + public static string Localize(this IStringLocalizer stringLocalizer, string message, IEnumerable arguments) { try { return arguments?.Count() > 0 - ? string.Format(stringLocalizer[format], LocalizeMessageArguments(stringLocalizer, arguments)?.ToArray()) - : stringLocalizer[format]; + ? stringLocalizer[message, LocalizeMessageArguments(stringLocalizer, arguments)?.ToArray()] + : stringLocalizer[message]; } catch { - return stringLocalizer[format]; + return stringLocalizer[message]; } } diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor index ac40aca83d..97001ee6ec 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/RoleManagement.razor @@ -1,5 +1,5 @@ @page "/identity/roles" -@attribute [Authorize( IdentityPermissions.Roles.Default )] +@attribute [Authorize(IdentityPermissions.Roles.Default)] @using Volo.Abp.Identity @using Microsoft.AspNetCore.Authorization @using Microsoft.Extensions.Localization diff --git a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor index 6f33181f8a..0a61fc70ab 100644 --- a/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor +++ b/modules/identity/src/Volo.Abp.Identity.Blazor/Pages/Identity/UserManagement.razor @@ -1,5 +1,5 @@ @page "/identity/users" -@attribute [Authorize( IdentityPermissions.Users.Default )] +@attribute [Authorize(IdentityPermissions.Users.Default)] @using Microsoft.AspNetCore.Authorization @using Microsoft.Extensions.Localization @using Volo.Abp.Identity.Localization