Ends in:
1 DAY
6 HRS
26 MIN
8 SEC
Ends in:
1 D
6 H
26 M
8 S
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 v9.1.0-preview. Updated on November 29, 2024, 05:50