58 lines
1.4 KiB
C#
58 lines
1.4 KiB
C#
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.Extensions.Configuration;
|
|
using MP.Data.DatabaseModels;
|
|
using NLog;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace MP.Data.Controllers
|
|
{
|
|
public class MpTabController : IDisposable
|
|
{
|
|
#region Public Constructors
|
|
|
|
public MpTabController(IConfiguration configuration)
|
|
{
|
|
_configuration = configuration;
|
|
Log.Info("Avviata classe MpTabController");
|
|
}
|
|
|
|
#endregion Public Constructors
|
|
|
|
#region Public Methods
|
|
|
|
public void Dispose()
|
|
{
|
|
_configuration = null;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Restituisce l'anagrafica eventi per intero
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<AnagEventiModel> AnagEventiGetAll()
|
|
{
|
|
List<AnagEventiModel> dbResult = new List<AnagEventiModel>();
|
|
using (var dbCtx = new MoonProContext(_configuration))
|
|
{
|
|
dbResult = dbCtx
|
|
.DbSetAnagEventi
|
|
.AsNoTracking()
|
|
.ToList();
|
|
}
|
|
return dbResult;
|
|
}
|
|
|
|
#endregion Public Methods
|
|
|
|
#region Private Fields
|
|
|
|
private static IConfiguration _configuration;
|
|
|
|
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
|
|
|
#endregion Private Fields
|
|
}
|
|
} |