У меня есть столбец таблицы DB, где некоторые свойства хранятся как JSON. Вот пример: < /p>
properties
----------
{ "SortBy" : "ASC" }
< /code>
List items = await this.dbContext.AllItems
.Where(x => x.field.CompanyId== CompanyId)
.OrderBy(x => x.Value);
< /code>
I need to change the OrderBy based on that JSON value. It can be ASC, DESC, or no OrderBy() if there is no value in there.
Any suggestions?
Подробнее здесь: https://stackoverflow.com/questions/797 ... lue-exists