Inizio aggiunta servizio x recupero RemRebLog ultimi eventi
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using MP.Data.DbModels;
|
||||
using MP.Core.Objects;
|
||||
using MP.Data.DbModels;
|
||||
using NLog;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using ZXing;
|
||||
using static MP.Core.Objects.Enums;
|
||||
|
||||
namespace MP.Data.Controllers
|
||||
@@ -72,6 +73,42 @@ namespace MP.Data.Controllers
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera tutti i record di RemoteRebootLog
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<RemoteRebootLogModel> RemRebootLogGetAll()
|
||||
{
|
||||
List<RemoteRebootLogModel> dbResult = new List<RemoteRebootLogModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetRemRebLog
|
||||
.AsNoTracking()
|
||||
.OrderByDescending(x => x.IdxReboot)
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Recupera ultimo record x ogni IdxMacchina x avere ultimo attivo
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public List<RemoteRebootLogModel> RemRebootLogGetLast()
|
||||
{
|
||||
List<RemoteRebootLogModel> dbResult = new List<RemoteRebootLogModel>();
|
||||
using (var dbCtx = new MoonProContext(_configuration))
|
||||
{
|
||||
dbResult = dbCtx
|
||||
.DbSetRemRebLog
|
||||
.FromSqlRaw("EXEC stp_RRL_getLast")
|
||||
.AsNoTracking()
|
||||
.ToList();
|
||||
}
|
||||
return dbResult;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Annulla modifiche su una specifica entity (cancel update)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user