private static Model.ParameterInfo[] Extract(DbParameterCollection p) { Model.ParameterInfo[] result = null; if (p.Count > 0) { result = new Model.ParameterInfo[p.Count]; for (int i = 0; i < result.Length; i++) { result[i].Name = p[i].ParameterName; result[i].Value = p[i].Value; } } return(result); }
private static Model.ParameterInfo[] Extract(DbParameterCollection p, DataRow[] rows, DataRowVersion version) { List <Model.ParameterInfo> result = new List <Model.ParameterInfo>(rows.Length * p.Count); if (p.Count > 0) { for (int r = 0; r < rows.Length; r++) { for (int i = 0; i < p.Count; i++) { var sub = new Model.ParameterInfo(); var parameter = p[i]; sub.Row = r; sub.Name = parameter.ParameterName; sub.Value = rows[r][parameter.SourceColumn, version]; result.Add(sub); } } } return(result.ToArray()); }