public IEnumerable <TRes> Result <TRes>() where TRes : class { Ai.Guard.Check(proc != null && proc.Connection != null, "MultiResult proc error"); if (numerator == null) { yield break; } if (typeof(TRes).Equals(typeof(object[]))) { do { var values = numerator.Current as object[]; // DbDataRecord; yield return(values as TRes); } while (numerator.MoveNext()); } var helper = new DbDataMapHelper <TRes>(); var cycle = numerator; do { var rec = numerator.Current as object[]; // as DbDataRecord; if (rec == null) { yield break; // first error } var objArray = DbRecord(reader.FieldCount); TRes obj = helper.SetValues(objArray); yield return(obj); }while (cycle.MoveNext()); }
public static IEnumerable <object[]> ResultObj(this SqlProc proc , Action <SqlField[]> onReadFields = null) { var cmd = proc.CreateCommand(); var helper = new DbDataMapHelper <object[]>(); return(DbGetHelper.ExecEnumerable(proc, helper, onReadFields: onReadFields)); }
public IList <T> Exec <T>(IList <T> list, Action <double> progress = null) where T : class { var helper = new DbDataMapHelper <T>(); DbGetHelper.ExecFill <T>(this, list, helper, progress); return(list); }
public IList <T> Exec <T>(IList <T> list, Action <double> progress = null) where T : class { Ai.Assert.IsTrue(list != null, "SqlProc.Exec list null error"); var helper = new DbDataMapHelper <T>(); DbGetHelper.ExecFill <T>(this, list, helper, progress); return(list); }
public IEnumerable <object[]> ExecEnum() { var helper = new DbDataMapHelper <object[]>(); return(DbGetHelper.ExecEnumerable(this, helper, null)); }