1 答案
-
0
If you're trying to do this for the
ExtraProperties
field in the database, you can't. Because the properties set in theExtraProperties
field are stored as a single JSON object.
However, you can refer to this document which explains the more natural way to do it.
If you have already mapped the property to ef core as stated in the document, you can use the query, below. Because the property you add is kept as a separate column in the database table.
var query = (await GetQueryableAsync()).Where(u => EF.Property<string>(u, "Nickname") == "John");
References:
- https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2021-05-24-Removing-EfCore-Migrations/POST.md#querying-based-on-a-custom-property
- https://github.com/abpframework/abp/blob/dev/docs/en/Community-Articles/2021-05-24-Removing-EfCore-Migrations/POST.md#mapping-to-the-database-table