I am passing in a query string that specifies a property to sort on but need to translate that to a property value in a model.
public class A
{
public int Prop1 {get; set;}
public int Prop2 {get; set;}
}
query string segment sort=Prop1
Server Side Code query is a IQueryable
query.OrderBy(x => x.{properyName})
I have parsed the property name value from the query string but now I need to translate that to x.Prop1 in the orderby lambda not sure a great way without using reflection