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
+2 -19
View File
@@ -13,8 +13,7 @@ namespace MP.Data.Repository.IOC
#region Protected Constructors
protected BaseRepository(IDbContextFactory<MoonProContext> ctxFactory)
=> _ctxFactory = ctxFactory;
protected BaseRepository(IDbContextFactory<MoonProContext> ctxFactory) => _ctxFactory = ctxFactory;
#endregion Protected Constructors
@@ -24,24 +23,8 @@ namespace MP.Data.Repository.IOC
/// Creazione dbcontext per singola transazione
/// </summary>
/// <returns></returns>
protected async Task<MoonProContext> CreateContextAsync()
=> await _ctxFactory.CreateDbContextAsync();
protected async Task<MoonProContext> CreateContextAsync() => await _ctxFactory.CreateDbContextAsync();
#endregion Protected Methods
#if false
/// <summary>
/// Salvataggio dati asincrono
/// </summary>
/// <returns></returns>
protected async Task<bool> SaveChangesAsync(DataLayerContext ctx)
=> await ctx.SaveChangesAsync() > 0;
#endif
#if false
protected readonly DataLayerContext _dbCtx;
protected BaseRepository(DataLayerContext db) => _dbCtx = db;
public async Task<bool> SaveChangesAsync() => await _dbCtx.SaveChangesAsync() > 0;
#endif
}
}