Inizio setup repository

This commit is contained in:
Samuele Locatelli
2026-06-01 16:43:40 +02:00
parent 3ea4b77827
commit 5c20387e1d
21 changed files with 738 additions and 96 deletions
+31
View File
@@ -0,0 +1,31 @@
using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
namespace MP.Data.Repository.Anag
{
public abstract class BaseRepository : IBaseRepository
{
#region Protected Fields
protected readonly IDbContextFactory<MoonProContext> _ctxFactory;
#endregion Protected Fields
#region Protected Constructors
protected BaseRepository(IDbContextFactory<MoonProContext> ctxFactory) => _ctxFactory = ctxFactory;
#endregion Protected Constructors
#region Protected Methods
/// <summary>
/// Creazione dbcontext per singola transazione
/// </summary>
/// <returns></returns>
protected async Task<MoonProContext> CreateContextAsync() => await _ctxFactory.CreateDbContextAsync();
#endregion Protected Methods
}
}