How can I transform this linq expression?
问题 Say I have an entity that I want to query with ranking applied: public class Person: Entity { public int Id { get; protected set; } public string Name { get; set; } public DateTime Birthday { get; set; } } In my query I have the following: Expression<Func<Person, object>> orderBy = x => x.Name; var dbContext = new MyDbContext(); var keyword = "term"; var startsWithResults = dbContext.People .Where(x => x.Name.StartsWith(keyword)) .Select(x => new { Rank = 1, Entity = x, }); var