Files
limanapp/LiMan.Api/Controllers/EnrollerController.cs
T

69 lines
1.9 KiB
C#

using LiMan.APi.Data;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using NLog;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace LiMan.APi.Controllers
{
/// <summary>
/// Controller livello APPLICAZIONE
/// </summary>
[Route("api/enroller")]
[ApiController]
public class EnrollerController : ControllerBase
{
#region Public Constructors
/// <summary>
/// Init generico
/// </summary>
/// <param name="DataService"></param>
public EnrollerController(ApiDataService DataService)
{
dataService = DataService;
Log.Info("Avviata classe ApplicazioneController");
}
#endregion Public Constructors
#region Public Methods
/// <summary>
/// Recupera conteggio del numero di task di enroll attivi al momento
/// GET api/enroller
/// </summary>
/// <param name="id">Codice cliente/Installazione</param>
/// <param name="CodApp">Codice Applicazione</param>
/// <returns></returns>
[HttpGet("{id}")]
public async Task<int> Get(string id = "NA", string CodApp = "Updater")
{
var resList = await dataService.EnrollReqGetActive();
int result = resList.Count;
await dataService.recordCall(id, CodApp, $"GET:api/enroller");
return result;
}
#endregion Public Methods
#region Protected Properties
/// <summary>
/// Dataservice x accesso DB
/// </summary>
protected ApiDataService dataService { get; set; }
#endregion Protected Properties
#region Private Fields
/// <summary>
/// Classe per logging
/// </summary>
private static Logger Log = LogManager.GetCurrentClassLogger();
#endregion Private Fields
}
}