This commit is contained in:
@@ -27,7 +27,7 @@ namespace AyaNova.Biz
|
||||
public static void PrimeManagerAccount(AyContext ct)
|
||||
{
|
||||
//get a db and logger
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("PrimeData");
|
||||
//ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("PrimeData");
|
||||
User u = new User();
|
||||
u.Active = true;
|
||||
u.Name = "AyaNova Administrator";
|
||||
|
||||
@@ -10,6 +10,8 @@ using AyaNova.Biz;
|
||||
using AyaNova.Models;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
|
||||
@@ -158,17 +160,12 @@ namespace AyaNova.Biz
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//get many (paged)
|
||||
internal async Task<ApiPagedResponse<Widget>> GetManyAsync(IUrlHelper Url, string routeName, PagingOptions pagingOptions)
|
||||
{
|
||||
|
||||
//TODO: build a query, run it outside of Entity Framework directly and return the results in models?!
|
||||
//Or can ef accept a query with criteria
|
||||
//https://docs.microsoft.com/en-us/ef/core/querying/raw-sql
|
||||
//If no datafilter then it can just run this regular code which already works, I think?
|
||||
//no, order by is brokeh
|
||||
|
||||
|
||||
pagingOptions.Offset = pagingOptions.Offset ?? PagingOptions.DefaultOffset;
|
||||
pagingOptions.Limit = pagingOptions.Limit ?? PagingOptions.DefaultLimit;
|
||||
|
||||
@@ -190,6 +187,14 @@ namespace AyaNova.Biz
|
||||
|
||||
//BUILD WHERE AND APPEND IT
|
||||
q = q + FilterSqlCriteriaBuilder.DataFilterToSQLCriteria(TheFilter, WidgetBiz.FilterOptions());
|
||||
|
||||
//TESTING:
|
||||
//LOG THE CRIT AND QUERY
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger("WidgetBiz::GetManyAsync");
|
||||
log.LogInformation("Filter criteria:");
|
||||
log.LogInformation(TheFilter.Filter);
|
||||
log.LogInformation("Generated SQL:");
|
||||
log.LogInformation(q);
|
||||
}
|
||||
|
||||
//BUILD ORDER BY AND APPEND IT
|
||||
|
||||
Reference in New Issue
Block a user