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
public static class QueryableExtensions | |
{ | |
public static IQueryable<T> Filter<T>(this IQueryable<T> queryable, IEnumerable<KeyValuePair<string, string>> filters) where T : class | |
{ | |
foreach (var filter in filters) | |
{ | |
var propertyName = typeof(T).GetProperties().Select(x => x.Name).SingleOrDefault(x => x.ToLower() == filter.Key.ToLower()); | |
if (propertyName.IsNullOrWhiteSpace()) continue; | |
var parameterExpression = Expression.Parameter(typeof(T)); | |
var propertyExpression = Expression.Property(parameterExpression, propertyName); |
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
<system.net> | |
<defaultProxy useDefaultCredentials="true" enabled="true"> | |
<proxy usesystemdefault="True" /> | |
</defaultProxy> | |
<settings> | |
<ipv6 enabled="true"/> | |
<servicePointManager expect100Continue="false" /> | |
</settings> | |
</system.net> |