Completo move Repo/Serv di ProdGroup
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using EgwCoreLib.Lux.Data.DbModel.Production;
|
||||
using static EgwCoreLib.Lux.Core.Enums;
|
||||
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
{
|
||||
public interface IProductionGroupRepository
|
||||
{
|
||||
Task<List<ProductionGroupModel>> GetByOrderRowAsync(int orderRowID);
|
||||
|
||||
Task<List<ProductionGroupModel>> GetByOrderStateAsync(OrderStates reqState);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using EgwCoreLib.Lux.Data.DbModel.Production;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using static EgwCoreLib.Lux.Core.Enums;
|
||||
|
||||
namespace EgwCoreLib.Lux.Data.Repository.Production
|
||||
{
|
||||
public class ProductionGroupRepository : BaseRepository, IProductionGroupRepository
|
||||
{
|
||||
#region Public Constructors
|
||||
|
||||
public ProductionGroupRepository(IDbContextFactory<DataLayerContext> ctxFactory) : base(ctxFactory)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion Public Constructors
|
||||
|
||||
#region Public Methods
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record ProductionGroup dato OrderRow
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ProductionGroupModel>> GetByOrderRowAsync(int orderRowID)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetProdGroup
|
||||
.AsNoTracking()
|
||||
.Where(x => x.OrderRowID == orderRowID)
|
||||
.Include(i => i.ItemsNav)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Elenco record ProductionGroup dato Stato dell'OrderRow
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<List<ProductionGroupModel>> GetByOrderStateAsync(OrderStates reqState)
|
||||
{
|
||||
await using var dbCtx = await CreateContextAsync();
|
||||
return await dbCtx.DbSetProdGroup
|
||||
.AsNoTracking()
|
||||
.Include(o => o.OrderRowNav)
|
||||
.Where(x => x.OrderRowNav.OrderRowState == reqState)
|
||||
.Include(i => i.ItemsNav)
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
#endregion Public Methods
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user