Open Closed

Adding Lookup table for a new field #4475


User avatar
0
moinahmed created

Hi,

I'm adding a new field in an existing table, and want to add a lookup table for it. Lookup table will have a few text entries a user can select from. One way I can think of adding a Lookup table is to use abp suite scaffolding, however, it generates a lot more code that looks an over kill for a table like that merely being setup once and will be update probably in years. Is there any simpler way for this in abp framework?

Thanks


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

    it generates a lot more code that looks an over kill for a table like that merely being setup once and will be update probably in years.

    Maybe you can use Enum, it is easier than lookup table.

    For exmaple:

    https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain/Volo/CmsKit/Blogs/BlogPost.cs#L34 https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Domain.Shared/Volo/CmsKit/Blogs/BlogPostStatus.cs https://github.com/abpframework/abp/blob/dev/modules/cms-kit/src/Volo.CmsKit.Admin.Web/Pages/CmsKit/BlogPosts/Index.cshtml#L42

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11