Continuo con Config e Cost
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(GlassModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -19,6 +20,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(GlassModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -26,12 +28,14 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<GlassModel>> GetAllAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetConfGlass.AsNoTracking().ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<GlassModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -40,6 +44,7 @@
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(GlassModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -19,6 +20,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddRangeAsync(List<ProfileModel> entityList)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -26,24 +28,28 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
dbCtx.DbSetConfProfile.Remove(entity);
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task<List<ProfileModel>> GetAllAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetConfProfile.AsNoTracking().ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<ProfileModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetConfProfile
|
||||
.FirstOrDefaultAsync(x => x.ProfileID == recId);
|
||||
}
|
||||
/// <inheritdoc />
|
||||
public async Task<ProfileModel?> GetByUidAsync(string uID)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -52,6 +58,7 @@
|
||||
}
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(ProfileModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> AddAsync(WoodModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -19,6 +20,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> DeleteAsync(WoodModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -26,6 +28,7 @@
|
||||
return await dbCtx.SaveChangesAsync() > 0;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<WoodModel>> GetAllAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -34,6 +37,7 @@
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<WoodModel?> GetByIdAsync(int recId)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
@@ -42,6 +46,7 @@
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<bool> UpdateAsync(WoodModel entity)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<List<EnvirParamModel>> GetAllAsync()
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
{
|
||||
public interface IConfGlassRepository : IBaseRepository
|
||||
{
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce un nuovo record Glass nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da inserire</param>
|
||||
Task<bool> AddAsync(GlassModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un record Glass dal database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(GlassModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera l'elenco completo dei vetri configurati.
|
||||
/// </summary>
|
||||
Task<List<GlassModel>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record Glass specifico per ID.
|
||||
/// </summary>
|
||||
/// <param name="recId">ID del vetro da recuperare</param>
|
||||
Task<GlassModel?> GetByIdAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna un record Glass esistente nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record aggiornato</param>
|
||||
Task<bool> UpdateAsync(GlassModel entity);
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,19 +1,46 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
{
|
||||
public interface IConfProfileRepository : IBaseRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Inserisce un nuovo record Profile nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da inserire</param>
|
||||
Task<bool> AddAsync(ProfileModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Inserisce in batch molteplici record Profile.
|
||||
/// </summary>
|
||||
/// <param name="entityList">Lista di record da inserire</param>
|
||||
Task<bool> AddRangeAsync(List<ProfileModel> entityList);
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un record Profile dal database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(ProfileModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera l'elenco completo dei profili configurati.
|
||||
/// </summary>
|
||||
Task<List<ProfileModel>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record Profile specifico per ID.
|
||||
/// </summary>
|
||||
/// <param name="recId">ID del profilo da recuperare</param>
|
||||
Task<ProfileModel?> GetByIdAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record Profile per UID (codice).
|
||||
/// </summary>
|
||||
/// <param name="uID">UID del profilo da recuperare</param>
|
||||
Task<ProfileModel?> GetByUidAsync(string uID);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna un record Profile esistente nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record aggiornato</param>
|
||||
Task<bool> UpdateAsync(ProfileModel entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,35 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
{
|
||||
public interface IConfWoodRepository : IBaseRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Inserisce un nuovo record Wood nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da inserire</param>
|
||||
Task<bool> AddAsync(WoodModel entity);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Elimina un record Wood dal database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record da eliminare</param>
|
||||
Task<bool> DeleteAsync(WoodModel entity);
|
||||
|
||||
/// <summary>
|
||||
/// Recupera l'elenco completo dei legni configurati.
|
||||
/// </summary>
|
||||
Task<List<WoodModel>> GetAllAsync();
|
||||
|
||||
/// <summary>
|
||||
/// Recupera un record Wood specifico per ID.
|
||||
/// </summary>
|
||||
/// <param name="recId">ID del legno da recuperare</param>
|
||||
Task<WoodModel?> GetByIdAsync(int recId);
|
||||
|
||||
/// <summary>
|
||||
/// Aggiorna un record Wood esistente nel database.
|
||||
/// </summary>
|
||||
/// <param name="entity">Record aggiornato</param>
|
||||
Task<bool> UpdateAsync(WoodModel entity);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Config
|
||||
{
|
||||
public interface IEnvirParamRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Recupera l'elenco completo dei parametri ambiente dal database.
|
||||
/// </summary>
|
||||
Task<List<EnvirParamModel>> GetAllAsync();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user