diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/CounterRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/CounterRepository.cs index 7b8c39e..b9c1e64 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/CounterRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/CounterRepository.cs @@ -15,6 +15,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils #region Public Methods + /// public async Task> GetAllAsync(int? yearRef = null) { await using var dbCtx = await CreateContextAsync(); @@ -24,7 +25,7 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils .ToListAsync(); } - + /// public async Task GetNextAsync(int yearRef, string countName) { await using var dbCtx = await CreateContextAsync(); diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/GenClassRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/GenClassRepository.cs index 53a6fd4..c617c82 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/GenClassRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/GenClassRepository.cs @@ -11,6 +11,7 @@ #endregion Public Constructors #region Public Methods + /// public async Task AddAsync(GenClassModel entity) { await using var dbCtx = await CreateContextAsync(); @@ -18,6 +19,7 @@ return await dbCtx.SaveChangesAsync() > 0; } + /// public async Task DeleteAsync(GenClassModel entity) { // Add validation for null entity @@ -33,12 +35,14 @@ + /// public async Task CountChildrenAsync(string classCod) { await using var dbCtx = await CreateContextAsync(); return await dbCtx.DbSetGenVal.CountAsync(x => x.ClassCod == classCod); } + /// public async Task> GetAllAsync() { await using var dbCtx = await CreateContextAsync(); @@ -48,12 +52,14 @@ .ToListAsync(); } + /// public async Task GetByCodeAsync(string code) { await using var dbCtx = await CreateContextAsync(); return await dbCtx.DbSetGenClass.FirstOrDefaultAsync(x => x.ClassCod == code); } + /// public async Task UpdateAsync(GenClassModel entity) { await using var dbCtx = await CreateContextAsync(); diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/GenValRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/GenValRepository.cs index 5a34ae3..a6e29b1 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/GenValRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/GenValRepository.cs @@ -12,6 +12,7 @@ #region Public Methods + /// public async Task AddAsync(GenValueModel entity) { await using var dbCtx = await CreateContextAsync(); @@ -19,6 +20,7 @@ return await dbCtx.SaveChangesAsync() > 0; } + /// public async Task DeleteAsync(GenValueModel rec2del) { // Add validation for null entity @@ -66,12 +68,14 @@ } } + /// public async Task GetByIdAsync(int Id) { await using var dbCtx = await CreateContextAsync(); return await dbCtx.DbSetGenVal.FirstOrDefaultAsync(x => x.GenValID == Id); } + /// public async Task> GetFiltAsync(string codClass) { await using var dbCtx = await CreateContextAsync(); @@ -81,6 +85,7 @@ .ToListAsync(); } + /// public async Task MoveAsync(GenValueModel selRec, bool moveUp) { // Add validation for null entity @@ -139,11 +144,12 @@ } } + /// public async Task UpdateAsync(GenValueModel entity) { await using var dbCtx = await CreateContextAsync(); // Recuperiamo l'entità tracciata dal context - var trackedEntity = dbCtx.DbSetGenVal.FirstOrDefaultAsync(x => x.GenValID == entity.GenValID); + var trackedEntity = await dbCtx.DbSetGenVal.FirstOrDefaultAsync(x => x.GenValID == entity.GenValID); if (trackedEntity != null) { diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/ICounterRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/ICounterRepository.cs index b4743ba..7ed72fd 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/ICounterRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/ICounterRepository.cs @@ -1,9 +1,23 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils { + /// + /// Interfaccia per la gestione dei contatori. + /// public interface ICounterRepository { + /// + /// Recupera l'elenco di tutti i contatori, opzionalmente filtrati per anno di riferimento. + /// + /// L'anno di riferimento (opzionale). + /// L'elenco dei contatori. Task> GetAllAsync(int? yearRef = null); + /// + /// Recupera il prossimo valore disponibile per un contatore specifico. + /// + /// L'anno di riferimento. + /// Il nome del contatore. + /// Il prossimo valore del contatore. Task GetNextAsync(int yearRef, string countName); } } diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/IGenClassRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/IGenClassRepository.cs index 9b9d305..63a3852 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/IGenClassRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/IGenClassRepository.cs @@ -1,21 +1,49 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils { + /// + /// Interfaccia per la gestione delle classi generiche. + /// public interface IGenClassRepository : IBaseRepository { - #region Public Methods - + /// + /// Inserisce una nuova classe generica nel database. + /// + /// La classe da inserire. + /// True se l'inserimento ha successo, false altrimenti. Task AddAsync(GenClassModel entity); + /// + /// Conta i valori associati a una classe generica. + /// + /// Il codice della classe. + /// Il numero di valori associati alla classe. Task CountChildrenAsync(string classCod); + /// + /// Elimina una classe generica dal database. + /// + /// La classe da eliminare. + /// True se l'eliminazione ha successo, false altrimenti. Task DeleteAsync(GenClassModel entity); + /// + /// Recupera l'elenco di tutte le classi generiche con i valori associati. + /// + /// L'elenco di tutte le classi generiche. Task> GetAllAsync(); + /// + /// Recupera una classe generica per il suo codice. + /// + /// Il codice della classe. + /// La classe corrispondente, o null se non esiste. Task GetByCodeAsync(string code); + /// + /// Aggiorna una classe generica esistente nel database. + /// + /// La classe aggiornata. + /// True se l'aggiornamento ha successo, false altrimenti. Task UpdateAsync(GenClassModel entity); - - #endregion Public Methods } } \ No newline at end of file diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/IGenValRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/IGenValRepository.cs index 7458003..db45a20 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/IGenValRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/IGenValRepository.cs @@ -1,21 +1,51 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils { + /// + /// Interfaccia per la gestione dei valori generici. + /// public interface IGenValRepository : IBaseRepository { - #region Public Methods - + /// + /// Inserisce un nuovo valore generico nel database. + /// + /// Il valore da inserire. + /// True se l'inserimento ha successo, false altrimenti. Task AddAsync(GenValueModel entity); + /// + /// Elimina un valore generico dal database e adegua gli indici successivi. + /// + /// Il valore da eliminare. + /// True se l'eliminazione ha successo, false altrimenti. Task DeleteAsync(GenValueModel entity); + /// + /// Recupera un valore generico per il suo identificatore. + /// + /// L'identificatore del valore. + /// Il valore corrispondente, o null se non esiste. Task GetByIdAsync(int Id); + /// + /// Recupera l'elenco dei valori generici per una classe specifica. + /// + /// Il codice della classe. + /// L'elenco dei valori associati alla classe. Task> GetFiltAsync(string codClass); + /// + /// Sposta su o giù un valore generico all'interno della sua classe. + /// + /// Il valore da spostare. + /// Se true, sposta il valore verso l'alto; altrimenti verso il basso. + /// True se lo spostamento ha successo, false altrimenti. Task MoveAsync(GenValueModel selRec, bool moveUp); + /// + /// Aggiorna un valore generico esistente nel database. + /// + /// Il valore aggiornato. + /// True se l'aggiornamento ha successo, false altrimenti. Task UpdateAsync(GenValueModel entity); - - #endregion Public Methods } } diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/ITagRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/ITagRepository.cs index fc86b86..b716e1a 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/ITagRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/ITagRepository.cs @@ -1,7 +1,14 @@ namespace EgwCoreLib.Lux.Data.Repository.Utils { + /// + /// Interfaccia per la gestione dei tag. + /// public interface ITagRepository { + /// + /// Recupera l'elenco di tutti i tag. + /// + /// L'elenco di tutti i tag. Task> GetAllAsync(); } } diff --git a/EgwCoreLib.Lux.Data/Repository/Utils/TagRepository.cs b/EgwCoreLib.Lux.Data/Repository/Utils/TagRepository.cs index a6cbefd..dce3d87 100644 --- a/EgwCoreLib.Lux.Data/Repository/Utils/TagRepository.cs +++ b/EgwCoreLib.Lux.Data/Repository/Utils/TagRepository.cs @@ -12,6 +12,7 @@ #region Public Methods + /// public async Task> GetAllAsync() { await using var dbCtx = await CreateContextAsync();