Breeze does not support this syntax, i.e. restricting a base class based on a subclasses criteria. ( Not sure how it could even be translated into a server query without some additional information).
Providing i'm understanding your schema correctly, I think that your best approach will be to use Breeze's 'withParameters' method in combination with another service endpoint where you handle the subtype manipulation. i.e. something like
[HttpGet]
public IQueryable<Request> RequestsForFilesEndingWith(string fileExtn) {
var requests = ContextProvider.Context.Requests
.Where(r => r.SourceMaterials.OfType<PhysicalFile>
.Any( pf => pf.FileName.EndsWith(fileExtn));
}
And your client query becomes:
var query = entityQuery.from('RequestsForFilesEndingWith')
.withParameters({ fileExtn: ".doc" });
Otherwise, the closest you will be able to get is to accomplish at least partial filtering by restricting on the 'resourceType' property ( which is on the base class) instead of the 'fileName' property
var query = entityQuery.from('Requests')
var predicate = new breeze.Predicate('sourceMaterials', 'any', new breeze.Predicate('sourceMaterial.resourceType', 'eq', ???fileNameResourceType???));