how can i display the properties from a ui user using abpio?

If you take a look at this documentation and for example this issue (which came from me :-|) you will see that you need to inherit from the page or component which you want to overwrite.

On the one hand you have the database layer and the domain layer which need the additional property/ properties. Your question shows code for the domain layer.

For EF Core you would need to customize the *EfCoreEntityExtensionMappings.cs which you find in the *.EntityFrameworkCore project.

Now for the application and services you need to go to your *.Application.Contracts Project and add code to the *DtoExtensions.cs (the class contains comments that describe how to do that).

Finally you create a new page (*.Blazor project) which will be your custom implementation of the default page.

Copy all content from the default page.

After that make sure that you inherit from the default page.

Now edit the code regarding to your needs.

As I had my diffuculties following the documentation I want to explain how I did that. If you wanted to customize the tenant management page the process would be:

  1. Create a page like “MyTenantManagement.razor”

  2. Get the default file content from here and paste it into “MyTenantManagement.razor”

  3. Replace the @inherits line with this:

    @inherits Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement.TenantManagement

  4. remove the @page thing (so that the router does not get confused

  5. add usings that may be missing (I had that so it might be a required step.

The upper part of the file may look like this:

@using Microsoft.AspNetCore.Authorization
@using Volo.Abp.FeatureManagement.Blazor.Components
@using Volo.Abp.TenantManagement.Localization
@using Volo.Abp.TenantManagement
@using TT2Masterz.Localization
@using Microsoft.Extensions.Localization

@inherits Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement.TenantManagement

@attribute [Authorize(TenantManagementPermissions.Tenants.Default)]
@attribute [ExposeServices(typeof(Volo.Abp.TenantManagement.Blazor.Pages.TenantManagement.TenantManagement))]
@attribute [Dependency(ReplaceServices = true)]

@inject AbpBlazorMessageLocalizerHelper<AbpTenantManagementResource> LH
@inject IStringLocalizer<TT2MasterzResource> LT

<h2>This is my custom tenant managemant page</h2>

I hope that this helps you 🙂

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top