Open Closed

module entity extension with one-many List from custom repository #426


User avatar
0
mmorrisset created
  • ABP Framework version: v3.1.2

  • UI type: MVC

  • Tiered (MVC) or Identity Server Seperated (Angular): no

  • Exception message and stack trace: NA

  • Steps to reproduce the issue:

Hi,
Started with the community edition and just bought the Commercial version for the modules / template. Created a new Commercial project and merged in my existing code. I have the basics figured out for adding columns to ABP (AppUsers) entities. With the OSS version I was overriding the Identity pages (Index, createmodal, editmodal) to display a drop down and all was well. It appears that I cannot do that with the commercial version. I can not get my existing overrides to work. Started reading the docs and found the "module entity extensions". I have my fields added to AbpUsers and displaying in the UI but I don't know how to make my "CountryId" field display as a drop down. Closest I found was https://docs.abp.io/en/commercial/latest/guides/module-entity-extensions#special-types which deals with enums. I essentially need the enum to be a list of Countries from another repo.

DB structure looks like this.

AbpUsers
added CountryId Guid

Country Entity
Id Guid
CountryName String

In my Createmodal and EditModal view model I had a property like so:

        [SelectItems(nameof(Countries))]
        [DisplayName("Country")]
        [BindProperty]
        public Guid CountryId { get; set; }

Countries was gathered like so:

            var cLkUp = await _countryAppService.GetCountryLookupAsync(Guid.Empty);
            if (cLkUp.Items.Count > 1 && cLkUp.Items[1] != null)
            {
                Countries = cLkUp.Items
                    .Where(x => x != null)
                    .Select(x => new SelectListItem(x.Name, x.Id.ToString()))
                    .ToList();
            }

I need what this this article is detailing, except the other way around. A user has a country. Countries have many users.

https://community.abp.io/articles/abp-suite-how-to-add-the-user-entity-as-a-navigation-property-of-another-entity-furp75ex


3 Answer(s)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08