G
G
gulitskiy2019-09-20 10:02:01
Entity Framework
gulitskiy, 2019-09-20 10:02:01

How to create sort in EntityFrameworkCore by JSON_VALUE?

There is a data type:
class LocalizedString {
public string Ru {get; set;}
public string En {get; set;}
}
It is stored in the database as Json, it is being converted to EntityFramework via ValueConverter
Now we need to implement such an extension for EntityFramework so that we can write either
items.OrderBy(x => x.FullName) or items.OrderBy(x => x.FullName.Ru)
FullName are properties of some EF object of LocalizedString type
Tried through DbFunctions Translation but it's not

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question