60 lines
1.5 KiB
C#
60 lines
1.5 KiB
C#
using Microsoft.Extensions.Configuration;
|
|
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.AppAuth.Controllers
|
|
{
|
|
public class MPController : IDisposable
|
|
{
|
|
#region Private Fields
|
|
|
|
private static IConfiguration _configuration;
|
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
public static AppAuth.Controllers.MPController dbController;
|
|
|
|
#endregion Private Fields
|
|
|
|
#region Public Constructors
|
|
|
|
public MPController(IConfiguration configuration)
|
|
{
|
|
_configuration = configuration;
|
|
Log.Info("Avviata classe MpController");
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
// Clear database controller
|
|
dbController.Dispose();
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// Elenco Record x AnagKeyValue
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<Models.AnagKeyValueModel> AnagKeyValuesGetAll()
|
|
{
|
|
List<Models.AnagKeyValueModel> dbResult = new List<Models.AnagKeyValueModel>();
|
|
using (MoonProContext localDbCtx = new MoonProContext(_configuration))
|
|
{
|
|
dbResult = localDbCtx
|
|
.DbSetAnagKeyValues
|
|
.ToList();
|
|
}
|
|
return dbResult;
|
|
}
|
|
|
|
|
|
#endregion Public Methods
|
|
}
|
|
} |