Upload files to 'STODataBaseImplement'

This commit is contained in:
Ivan_Starostin 2024-05-01 15:12:27 +04:00
parent 0c383959c7
commit 2ba1270f29

View File

@ -33,8 +33,12 @@ namespace DatabaseImplement
using var context = new STODatabase();
return context.TechnicalWorks.Include(x => x.Works)
.ThenInclude(x => x.Work)
.Where(x => x.Name.Contains(model.Name))
.ToList()
.Where(x => (
(!model.Id.HasValue || x.Id == model.Id) &&
(!model.DateFrom.HasValue || x.Date >= model.DateFrom) &&
(!model.DateTo.HasValue || x.Date <= model.DateTo)
)
)
.Select(x => x.GetViewModel)
.ToList();
}