This project is read-only.

Dynamic filter:

string filer; //optional filter

var query =
   from n in Table
   where filter.HasValue().Then(()=> n.XX == filter)
   select n;


static class Helper
{
    public static bool HasValue(this string str)
    {
       return !string.IsNullOrEmpty(str);
    }

    public static T Then<T>(this bool condition, Func<T> valueProvider) where T : struct
    {
       return condition ? valueProvider() : default(T);
    }
}

Last edited Oct 14, 2013 at 3:54 AM by westjeffho, version 3

Comments

No comments yet.