http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/925b245d-5529-4a64-8cd4-4bc83ee6fe7a/
public static class PredicateBuilder
{
public static Expression<Func<T, bool>> Make<T>() { return null; }
public static Expression<Func<T, bool>> Make<T>(this Expression<Func<T, bool>> predicate)
{
return predicate;
}
public static Expression<Func<T, bool>> MakePredicate<T>(this IQueryable<T> source)
{
return null;
}
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr, Expression<Func<T, bool>> or)
{
if (expr == null) return or;
var invokedExpr = Expression.Invoke(or, expr.Parameters.Cast<Expression>());
return Expression.Lambda<Func<T, bool>>(Expression.Or(expr.Body, invokedExpr), expr.Parameters);
}
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr, Expression<Func<T, bool>> and)
{
if (expr == null) return and;
var invokedExpr = Expression.Invoke(and, expr.Parameters.Cast<Expression>());
return Expression.Lambda<Func<T, bool>>(Expression.And(expr.Body, invokedExpr), expr.Parameters);
}
}
{
public static Expression<Func<T, bool>> Make<T>() { return null; }
public static Expression<Func<T, bool>> Make<T>(this Expression<Func<T, bool>> predicate)
{
return predicate;
}
public static Expression<Func<T, bool>> MakePredicate<T>(this IQueryable<T> source)
{
return null;
}
public static Expression<Func<T, bool>> Or<T>(this Expression<Func<T, bool>> expr, Expression<Func<T, bool>> or)
{
if (expr == null) return or;
var invokedExpr = Expression.Invoke(or, expr.Parameters.Cast<Expression>());
return Expression.Lambda<Func<T, bool>>(Expression.Or(expr.Body, invokedExpr), expr.Parameters);
}
public static Expression<Func<T, bool>> And<T>(this Expression<Func<T, bool>> expr, Expression<Func<T, bool>> and)
{
if (expr == null) return and;
var invokedExpr = Expression.Invoke(and, expr.Parameters.Cast<Expression>());
return Expression.Lambda<Func<T, bool>>(Expression.And(expr.Body, invokedExpr), expr.Parameters);
}
}
'컴퓨터 프로그래밍 > ASP.NET / Silverlight / MSSQL' 카테고리의 다른 글
ASP.NET + Silverlight + WCF (0) | 2009.12.21 |
---|---|
asp.net / wcf 사용시 .svc 의 처리기매핑이 제대로 안된경우 (0) | 2009.12.21 |