From 2ba1270f293c8f9dc9559fed2c38433b55502ffa Mon Sep 17 00:00:00 2001 From: Ivan_Starostin Date: Wed, 1 May 2024 15:12:27 +0400 Subject: [PATCH] Upload files to 'STODataBaseImplement' --- STODataBaseImplement/TechnicalWorkStorage.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/STODataBaseImplement/TechnicalWorkStorage.cs b/STODataBaseImplement/TechnicalWorkStorage.cs index 5a6bb75..c6c5c07 100644 --- a/STODataBaseImplement/TechnicalWorkStorage.cs +++ b/STODataBaseImplement/TechnicalWorkStorage.cs @@ -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(); }