var PersonalFieldBoundary = await _medicalDbContext.PersonalFieldBoundaries.Include( x=>x.FieldBoundary) .AsNoTracking() .Where(x => x.ParticipantId == participantId && x.Start <= insertDate) .GroupBy(x => new { x.FieldBoundaryId }) .Select(x => x.OrderByDescending(x => x.Start) .Take(1)) .SelectMany(x => x) .ToListAsync(); return PersonalFieldBoundary;