[Ironpython-users] how to pass parameter to (this IQueryable<T> table, Expression<Func<T, bool>> predicate)

ecinunice at gmail.com ecinunice at gmail.com
Wed Jul 16 09:15:02 CEST 2014


I want to use https://github.com/linq2db/linq2db in ironpython
I wrote extension in c#
        public static class BillingDBHelper
        {
                public static IQueryable<T> Filter<T>(this IQueryable<T> table, Expression<Func<T, bool>> predicate)
                {
                        if (predicate == null)
                                return table;
                        return table.Where(predicate);
                }
        }

and call it in py

    with get_db() as db:
        cycle = db.t_ws_billing_cycle.Filter(lambda x: x.policy_no == pn)

and get TypeError: The type arguments for method 'Filter' cannot be inferred from the usage. Try specifying the type arguments explicitly.
How to fix?
Or how i build c# expression lambda in ironpython?
Thanks



More information about the Ironpython-users mailing list