У меня проблема с запросом LINQ с использованием aspnetboilerplate. несмотря на предложение where, он возвращает все записи.
Я хочу выбрать все записи с EnrolResponse.IsComplete = true.
у меня есть три объекта
public class User : Entity<int>, IFullAudited
{
public string Email { get; set; }
public List<EnrollAttemptRequest> EnrollAttempts { get; set; }
}
public class EnrollAttemptRequest : Entity<int>
{
public int UserId { get; set; }
public EnrollAttemptResponse EnrolResponse { get; set; }
}
public class EnrollAttemptResponse : Entity<int>, IFullAudited
{
public int EnrollAttemptRequestId { get; set; }
public bool IsComplete { get; set; }
}
следующий запрос возвращает все записи, даже если IsComplete равно false.
var enroledUsers = await _userRepository.GetAll()
.Where(x => x.EnrollAttempts.Any(y=>y.EnrolResponse.IsComplete == true))
.Include(x=>x.EnrollAttempts)
.ThenInclude(x=>x.EnrolResponse)
.ToListAsync();
Если разбить запрос на IQueryable, но я получаю тот же результат