This commit is contained in:
@@ -7,13 +7,13 @@ using System.Linq;
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
|
||||||
namespace AyaNova.Biz
|
namespace AyaNova.DataList
|
||||||
{
|
{
|
||||||
public static class SqlSelectBuilder
|
internal static class DataListSqlSelectBuilder
|
||||||
{
|
{
|
||||||
|
|
||||||
//Build the SELECT portion of a list query based on the template, mini or full and the object key in question
|
//Build the SELECT portion of a list query based on the template, mini or full and the object key in question
|
||||||
public static string Build(List<AyaObjectFieldDefinition> objectFieldsList, string template, bool mini)
|
internal static string Build(List<AyaDataListFieldDefinition> objectFieldsList, string template, bool mini)
|
||||||
{
|
{
|
||||||
|
|
||||||
//parse the template
|
//parse the template
|
||||||
@@ -35,7 +35,7 @@ namespace AyaNova.Biz
|
|||||||
sb.Append("SELECT ");
|
sb.Append("SELECT ");
|
||||||
|
|
||||||
//Default ID column for each row (always is aliased as df)
|
//Default ID column for each row (always is aliased as df)
|
||||||
AyaObjectFieldDefinition def = objectFieldsList.FirstOrDefault(x => x.FieldKey == "df");
|
AyaDataListFieldDefinition def = objectFieldsList.FirstOrDefault(x => x.FieldKey == "df");
|
||||||
if (def == null)
|
if (def == null)
|
||||||
{
|
{
|
||||||
throw new System.ArgumentNullException("SqlSelectBuilder: objectFieldList is missing the df default field");
|
throw new System.ArgumentNullException("SqlSelectBuilder: objectFieldList is missing the df default field");
|
||||||
@@ -53,7 +53,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
foreach (string ColumnName in templateFieldList)
|
foreach (string ColumnName in templateFieldList)
|
||||||
{
|
{
|
||||||
AyaObjectFieldDefinition o = objectFieldsList.FirstOrDefault(x => x.FieldKey == ColumnName);
|
AyaDataListFieldDefinition o = objectFieldsList.FirstOrDefault(x => x.FieldKey == ColumnName);
|
||||||
#if (DEBUG)
|
#if (DEBUG)
|
||||||
//Developers little helper
|
//Developers little helper
|
||||||
if (o == null)
|
if (o == null)
|
||||||
@@ -9,6 +9,7 @@ using AyaNova.Util;
|
|||||||
using AyaNova.Api.ControllerHelpers;
|
using AyaNova.Api.ControllerHelpers;
|
||||||
using AyaNova.Models;
|
using AyaNova.Models;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using AyaNova.DataList;
|
||||||
|
|
||||||
namespace AyaNova.Biz
|
namespace AyaNova.Biz
|
||||||
{
|
{
|
||||||
@@ -406,6 +407,8 @@ namespace AyaNova.Biz
|
|||||||
#region TestGetWidgetUserEmailList
|
#region TestGetWidgetUserEmailList
|
||||||
internal async Task<ApiPagedResponse> TestGetWidgetUserEmailList(IUrlHelper Url, string routeName, ListOptions listOptions)
|
internal async Task<ApiPagedResponse> TestGetWidgetUserEmailList(IUrlHelper Url, string routeName, ListOptions listOptions)
|
||||||
{
|
{
|
||||||
|
//var dlist=AyaNova.DataList.DataListFactory.GetListOfAllDataListKeyNames();
|
||||||
|
|
||||||
//TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
|
//TODO: Get template (MOCKED FOR NOW UNTIL PROOF OF CONCEPT)
|
||||||
var MOCK_WIDGET_USER_EMAIL_DISPLAY_TEMPLATE_JSON = @"
|
var MOCK_WIDGET_USER_EMAIL_DISPLAY_TEMPLATE_JSON = @"
|
||||||
{
|
{
|
||||||
@@ -414,8 +417,9 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
";
|
";
|
||||||
|
|
||||||
var AyaObjectFields = AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldDefinitions.TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY);
|
// var AyaObjectFields = AyaObjectFieldDefinitions.AyaObjectFields(AyaObjectFieldDefinitions.TEST_WIDGET_USER_EMAIL_ADDRESS_LIST_KEY);
|
||||||
|
var DataList=DataListFactory.GetAyaDataList(nameof(TestWidgetUserEmailDataList));
|
||||||
|
|
||||||
|
|
||||||
//TODO: PUt this in the template biz class ultimately and modify sqlselectbuilder to use it
|
//TODO: PUt this in the template biz class ultimately and modify sqlselectbuilder to use it
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user