Files
mapo-core/MP.Data/Repository/Utils/BaseRepository.cs
T
2026-06-01 16:43:40 +02:00

31 lines
854 B
C#

using Microsoft.EntityFrameworkCore;
using System.Threading.Tasks;
namespace MP.Data.Repository.Utils
{
public abstract class BaseRepository : IBaseRepository
{
#region Protected Fields
protected readonly IDbContextFactory<MoonPro_UtilsContext> _ctxFactory;
#endregion Protected Fields
#region Protected Constructors
protected BaseRepository(IDbContextFactory<MoonPro_UtilsContext> ctxFactory) => _ctxFactory = ctxFactory;
#endregion Protected Constructors
#region Protected Methods
/// <summary>
/// Creazione dbcontext per singola transazione
/// </summary>
/// <returns></returns>
protected async Task<MoonPro_UtilsContext> CreateContextAsync() => await _ctxFactory.CreateDbContextAsync();
#endregion Protected Methods
}
}