Open Closed

Code Generated with error for 2 attribute of IdentityUser Data Type #10941


User avatar
0
johnsonlim created

Hi, This is the error i have

This is IdentityUser Data Type for the attribute

| Attribute | | | --------- | --- | | usermaintenanceUserId | | | supervidorId | |

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Hi,

    When two navigation properties point to the same entity (IdentityUser here), ABP Suite generates the lookup only for the first one in UserMaintenances.razor.cs. The razor page still uses supervisorCollection, so the build fails.

    For now, you can add the missing part to UserMaintenances.Extended.razor.cs. Suite doesn't overwrite this file when you regenerate the page.

    using System;
    using System.Collections.Generic;
    using System.Threading.Tasks;
    using AbpSolution1.Shared;
    
    namespace AbpSolution1.Blazor.Pages;
    
    public partial class UserMaintenances
    {
        private IReadOnlyList<LookupDto<Guid>> supervisorCollection { get; set; } = new List<LookupDto<Guid>>();
    
        protected override async Task OnParametersSetAsync()
        {
            supervisorCollection = (await UserMaintenancesAppService.GetsupervisorLookupAsync(new LookupRequestDto())).Items;
        }
    }
    

    The app service already has GetsupervisorLookupAsync, so nothing else needs to change.

    This is fixed in ABP Suite 10.7.0. After you upgrade Suite and regenerate the page, remove this code from the extended file, because the generated file will have supervisorCollection itself.

    Thanks

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 21, 2026, 11:09
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.