This commit is contained in:
2020-01-20 19:02:57 +00:00
parent af99720eda
commit 8d9fc80e68

View File

@@ -468,9 +468,8 @@ namespace AyaNova.Biz
//RETURN OBJECTS
//todo: need exact rowcount so can set up array on each row
//need to know which index of each row is going to need the id of the next row
//get the return row object count (number of items in each return row)
int returnRowCount = AyaObjectFields.Count();
List<List<AyaFieldData>> rows = new List<List<AyaFieldData>>();
long totalRecordCount = 0;
@@ -484,10 +483,21 @@ namespace AyaNova.Biz
{
while (dr.Read())
{
object[] row = new object[dr.FieldCount];
dr.GetValues(row);
List<AyaFieldData> row = new List<AyaFieldData>(returnRowCount);
//Iterate object fields, build return row list as required
//INSERT INTO THE RETURN ROWS LIST
items.Add(row);
foreach (AyaObjectFieldDefinition f in AyaObjectFields)
{
AyaFieldData d = new AyaFieldData();
d.v = dr.GetValue(dr.GetOrdinal(f.SqlDisplayColumnName));
if (f.SqlIdColumnName != null)
{
d.Id = dr.GetInt64(dr.GetOrdinal(f.SqlIdColumnName));
}
}
rows.Add(row);
}
}