Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I tried on two ways to choose to date only from the date frame but still, I get the wrong result. I saw another post but the response doesn't work for me. Please help mine.

 List<Measurement> measurementsForTemplate = await databaseCommandContext.CreateSet<Measurement>()
                .Include(v => v.MeasuredValues)
                .Where(x => x.MeasurementFormTemplateId == command.TemplateId )
                .Where(v => v.MeasuredValues.Any(d => d.Time >= command.FromDate))
                .Where(v => v.MeasuredValues.Any(d => d.Time <= command.ToDate)).ToListAsync(cancellationToken);

Or I created an object without filtering in the above query and then

    var measurementsForTemplateDateLimit = measurementsForTemplate.Where(b => b.MeasuredValues
    .Any(d => d.Time >= command.FromDate && d.Time <= command.ToDate)).Select(b => b);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
179 views
Welcome To Ask or Share your Answers For Others

1 Answer

See figure below with solution enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...