This commit is contained in:
2021-01-27 23:32:05 +00:00
parent d44361fc19
commit 34a4c31249
17 changed files with 106 additions and 101 deletions

View File

@@ -88,7 +88,7 @@ namespace AyaNova.DataList
//Developers little helper
if (o == null)
{
throw new System.ArgumentNullException($"DEV ERROR in AyaDataList::GenerateListColumnsJSONFromListView - field {s} specified in ListView was NOT found in ObjectFields list");
throw new System.ArgumentNullException($"DEV ERROR in AyaDataList::GenerateReturnListColumns - field {s} specified in columns was NOT found in ObjectFields list");
}
#endif

View File

@@ -12,8 +12,8 @@ namespace AyaNova.DataList
internal static class DataListSqlSelectBuilder
{
//Build the SELECT portion of a list query based on the ListView fields
internal static SqlSelectBuilderResult Build(List<AyaDataListFieldDefinition> objectFieldsList, List<string> listViewFieldList)
//Build the SELECT portion of a list query based on the columns
internal static SqlSelectBuilderResult Build(List<AyaDataListFieldDefinition> objectFieldsList, List<string> columns)
{
StringBuilder sb = new StringBuilder();
sb.Append("SELECT ");
@@ -26,14 +26,14 @@ namespace AyaNova.DataList
int nOrdinal = 0;
var firstColumnAdded = false;
foreach (string ColumnName in listViewFieldList)
foreach (string ColumnName in columns)
{
AyaDataListFieldDefinition o = objectFieldsList.FirstOrDefault(z => z.FieldKey == ColumnName);
#if (DEBUG)
//Developers little helper
if (o == null)
{
throw new System.ArgumentNullException($"## DEV ERROR in DataListSqlSelectBuilder.cs:Build() field {ColumnName} specified in datalist view was NOT found in the data list's ObjectFields list, a defined fieldkey name differs from the ListView field key name");
throw new System.ArgumentNullException($"## DEV ERROR in DataListSqlSelectBuilder.cs:Build() field {ColumnName} specified in columns was NOT found in the data list's ObjectFields list, a defined fieldkey name differs from the columns key name");
}
#endif
if (o != null)