How can I do something like this:
var result = db.MyTable.Where(x => x.\"MyProperty\" == \"Test\" );
As you can see I want to access \"MyProperty\" but
I think you can try this:
public static IQueryable SortByPropertyName(this IQueryable queryable, string orderFieldName) where T : Entity
{
var param = Expression.Parameter(typeof(T), typeof(T).Name);
var orderExpression = Expression.Lambda>(Expression.Property(param, orderFieldName), param);
return queryable.OrderBy(orderExpression);
}
It works fine for order.