This commit is contained in:
2020-01-22 15:49:04 +00:00
parent 5565424108
commit 7d3d9cfeee
3 changed files with 34 additions and 17 deletions

View File

@@ -109,26 +109,27 @@ namespace AyaNova.Biz
/// GET
//Get one
internal async Task<DataListTemplate> GetAsync(string DataListKey, bool log=true)
internal async Task<DataListTemplate> GetAsync(string DataListKey, bool log, IAyaDataList dataList)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
var ret = await ct.DataListTemplate.SingleOrDefaultAsync(m => m.Id == fetchId && (m.Public == true || m.UserId == UserId));
if (ret != null)
//DataListKey always exists, if not in db then in default form
var ret = await ct.DataListTemplate.SingleOrDefaultAsync(m => m.DataListKey == DataListKey);
if (log)
{
//Log
EventLogProcessor.LogEventToDatabase(new Event(UserId, fetchId, BizType, AyaEvent.Retrieved), ct);
EventLogProcessor.LogEventToDatabase(new Event(UserId, ret.Id, BizType, AyaEvent.Retrieved), ct);
}
return ret;
}
////////////////////////////////////////////////////////////////////////////////////////////////
/// GET
internal async Task<DataListTemplate> GetNoLogAsync(long fetchId)
{
//This is simple so nothing more here, but often will be copying to a different output object or some other ops
return await ct.DataListTemplate.SingleOrDefaultAsync(m => m.Id == fetchId);
}
// ////////////////////////////////////////////////////////////////////////////////////////////////
// /// GET
// internal async Task<DataListTemplate> GetNoLogAsync(long fetchId)
// {
// //This is simple so nothing more here, but often will be copying to a different output object or some other ops
// return await ct.DataListTemplate.SingleOrDefaultAsync(m => m.Id == fetchId);
// }
// //get picklist (NOT PAGED)
// internal async Task<List<NameIdItem>> GetPickListAsync(string listKey)