Last active
May 17, 2020 23:19
-
-
Save zHaytam/20b52ba9690786d2a9772aa74144c7ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var propertyGetter = DynamicExpressions.GetPropertyGetter<Product>(propertySentByUser); | |
// ^ can be cached or even compiled to a Func<Product, object> | |
var query = _dbContext.Products.AsQueryable().OrderBy(propertyGetter); | |
// Or OrderByDesceding |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment