доработка метода получения отчета по заявкам
This commit is contained in:
parent
0a00c532db
commit
148abdfb8e
@ -59,7 +59,7 @@ namespace CarServiceDatabase.Implements
|
||||
.Select(w => new ReportWorkWithRequestsViewModel()
|
||||
{
|
||||
WorkName = w.Name,
|
||||
RepairRequests = GetRepairRequestsByWork(model)
|
||||
RepairRequests = GetRepairRequestsByWork(context, new() { Id = w.Id })
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
@ -68,9 +68,8 @@ namespace CarServiceDatabase.Implements
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
private List<ReportRepairRequestViewModel> GetRepairRequestsByWork(WorkSearchModel model)
|
||||
private static List<ReportRepairRequestViewModel> GetRepairRequestsByWork(CarServiceDbContext context, WorkSearchModel model)
|
||||
{
|
||||
using var context = new CarServiceDbContext();
|
||||
return context.WorksInRequest
|
||||
.Include(wir => wir.RepairRequest)
|
||||
.ThenInclude(rr => rr.Vehicle)
|
||||
|
Loading…
Reference in New Issue
Block a user