public static KeyValuePair <ResultDyn, IEnumerable <T> > ResultObj <T>(this Context db, object named , Action <SqlCommand> setupCmd = null , Action <Exception> onError = null) { var proc = SqlProcExt.ProcNamed(named); SqlDataReader reader = null; ResultDyn dyn = DbEnumeratorData.GetResultDyn(LazyReader(proc, (r) => reader = r, setupCmd, onError)); return(CastResult <T>(dyn, onError)); }
public static KeyValuePair <ResultDyn, IEnumerable <T> > CastResult <T>(this ResultDyn dyn , Action <Exception> onError = null) { return(new KeyValuePair <ResultDyn, IEnumerable <T> >(dyn, dyn.Cast <T>())); }