The only thing I can think of is that there might be a mixup with the Entity Model class of the same name. I'd double check all references and make sure the assembly holding the domain model builds OK (unless of course it's the same assembly which is failing here).
You'll get a runtime error with the above code, however. The ServerEntityQuery passed into the method cannot be cast to an EntityQuery<T>; so just cast to an EntityQuery before applying the filter.