Skip to content

Instantly share code, notes, and snippets.

View rodrigokono's full-sized avatar
Me siga no instagram: @rodrigo.kono

Rodrigo Kono rodrigokono

Me siga no instagram: @rodrigo.kono
View GitHub Profile
@rodrigokono
rodrigokono / gist:2907855
Created June 11, 2012 00:33
IQueryable Dynamic Expressions
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);
<system.net>
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy usesystemdefault="True" />
</defaultProxy>
<settings>
<ipv6 enabled="true"/>
<servicePointManager expect100Continue="false" />
</settings>
</system.net>