I am using C# (including Linq) to develop a web application. I have written a generic method to extend Get method of any entity. However when I get the runtime exception \'T
I beleive the problem is in your And method. You can create the expression yourself using the static Expression methods
public static IEnumerable GetActive(this ICrudService crudService, Expression> where)
where T : class, IDeletable
{
var parameter = where.Parameters.FirstOrDefault();
var property = Expression.PropertyOrField(parameter, "IsDeleted");
var notProperty = Expression.Not(property);
var andExpression = Expression.AndAlso(where.Body, notProperty);
var lambda = Expression.Lambda>(andExpression, parameter);
return crudService.Get(lambda);
}