Geeks With Blogs
.Nettuce Code Salad May 2012 Entries
IQueryable Dynamic Expressions
public static class QueryableExtensions { public static IQueryable<T> Filter<T>(this IQueryable<T> queryable, IEnumerable<KeyValuePair... string>> filters) where T : class { foreach (var filter in filters) { var propertyName = typeof(T).GetProperties().S... => x.Name).SingleOrDefault(x => x.ToLower() == filter.Key.ToLower()); if (propertyName.IsNullOrWhite... continue; var parameterExpression = Expression.Parameter(typeof... var propertyExpression ......

Posted On Tuesday, May 15, 2012 9:19 PM

Copyright © Jon Canning | Powered by: GeeksWithBlogs.net