This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
using System.Threading.Tasks;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.AspNetCore.Routing;
|
using Microsoft.AspNetCore.Routing;
|
||||||
@@ -7,7 +6,6 @@ using Microsoft.Extensions.Logging;
|
|||||||
using AyaNova.Models;
|
using AyaNova.Models;
|
||||||
using AyaNova.Api.ControllerHelpers;
|
using AyaNova.Api.ControllerHelpers;
|
||||||
using AyaNova.Biz;
|
using AyaNova.Biz;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace AyaNova.Api.Controllers
|
namespace AyaNova.Api.Controllers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get ServiceBank
|
/// Get ServiceBank
|
||||||
/// (This object is create / get only, there is no update or delete only adjustments through new entries)
|
/// (This object is create / get only, there is no update or delete. Only adjustments through new entries)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="id"></param>
|
/// <param name="id"></param>
|
||||||
/// <returns>ServiceBank</returns>
|
/// <returns>ServiceBank</returns>
|
||||||
|
|||||||
@@ -22,15 +22,14 @@ namespace AyaNova.PickList
|
|||||||
cm.fld = "widgetserial";
|
cm.fld = "widgetserial";
|
||||||
dTemplate.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
//todo: For testing only
|
|
||||||
cm = new JObject();
|
|
||||||
cm.fld = "widgettags";
|
|
||||||
dTemplate.Add(cm);
|
|
||||||
|
|
||||||
cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "username";
|
cm.fld = "username";
|
||||||
dTemplate.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "widgettags";
|
||||||
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
base.DefaultTemplate = dTemplate.ToString(Newtonsoft.Json.Formatting.None);
|
||||||
|
|
||||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
||||||
|
|||||||
@@ -117,22 +117,22 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<ServiceBank> GetAsync(long id, bool logTheGetEvent = true)
|
internal async Task<ServiceBank> GetAsync(long id, bool logTheGetEvent = true)
|
||||||
{
|
{
|
||||||
var ret = await ct.ServiceBank.SingleOrDefaultAsync(m => m.Id == id);
|
var ret = await ct.ServiceBank.AsNoTracking().SingleOrDefaultAsync(m => m.Id == id);
|
||||||
if (logTheGetEvent && ret != null)
|
if (logTheGetEvent && ret != null)
|
||||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//GET LAST
|
// //GET LAST
|
||||||
//
|
// //
|
||||||
internal async Task<ServiceBank> GetLastForObjectAsync(AyaType objectType, long objectId)
|
// internal async Task<ServiceBank> GetLastForObjectAsync(AyaType objectType, long objectId)
|
||||||
{
|
// {
|
||||||
|
|
||||||
var ret = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).SingleOrDefaultAsync(m => m.ObjectId == objectId && m.ObjectType == objectType);
|
// var ret = await ct.ServiceBank.OrderByDescending(m => m.EntryDate).SingleOrDefaultAsync(m => m.ObjectId == objectId && m.ObjectType == objectType);
|
||||||
|
|
||||||
return ret;
|
// return ret;
|
||||||
}
|
// }
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//SEARCH
|
//SEARCH
|
||||||
@@ -149,7 +149,7 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
public async Task<Search.SearchIndexProcessObjectParameters> GetSearchResultSummary(long id)
|
public async Task<Search.SearchIndexProcessObjectParameters> GetSearchResultSummary(long id)
|
||||||
{
|
{
|
||||||
var obj = await ct.ServiceBank.SingleOrDefaultAsync(z => z.Id == id);
|
var obj = await GetAsync(id,false);
|
||||||
var SearchParams = new Search.SearchIndexProcessObjectParameters();
|
var SearchParams = new Search.SearchIndexProcessObjectParameters();
|
||||||
DigestSearchText(obj, SearchParams);
|
DigestSearchText(obj, SearchParams);
|
||||||
return SearchParams;
|
return SearchParams;
|
||||||
|
|||||||
Reference in New Issue
Block a user