我正在尝试使用以下代码过滤一些记录:
return base.CreateFilteredQuery(input)
.WhereIf(input.OrganisationUnitId > 0, t => t.Records.Any(x => input.OrganisationUnitId == x.Record.OrganisationUnitId))
.WhereIf(!input.Term.IsNullOrEmpty(), w => w.CreatorUser.FullName.Contains(input.Term));
但是我收到最近的“经典”错误:
.LeftJoin(
outer: DbSet<User>
.Where(u => __ef_filter__p_8 || !(((ISoftDelete)u).IsDeleted) && __ef_filter__p_9 || ((IMayHaveTenant)u).TenantId == __ef_filter__CurrentTenantId_10),
inner: p => EF.Property<Nullable<long>>(p, "CreatorUserId"),
outerKeySelector: u => EF.Property<Nullable<long>>(u, "Id"),
innerKeySelector: (o, i) => new TransparentIdentifier<PrintJob, User>(
Outer = o,
Inner = i
))
.Where(p => p.Inner.FullName.Contains(__input_Term_1))' could not be translated.
我知道w.Status.Contains(input.Term)可以正常工作,所以我假设它不喜欢它的CreatorUser子实体。我打算对任何子实体运行查询吗?