Starts in:
2 DAYS
3 HRS
31 MIN
41 SEC
Starts in:
2 D
3 H
31 M
41 S
Open Closed

DbContext Order By Extra Propeties Not Working #4970


User avatar
0
muhannad created

I want to order by the extra Propeties , I have a column in database Called RankOrder , I tried this

` order by user.GetProperty

`

its not working , any suggestions please


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

    Hi,

    You can try:

    .OrderBy(b => EF.Property<int>(b, "RankOrder"));
    

    You have to add RankOrder as a separate field of the table

    See: https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Extending-Entities#entity-extensions-ef-core

  • User Avatar
    0
    muhannad created

    Thnx , it worked

Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06