Hi Brakowski,
Basically you'd replace FilterEmailMessageAddressEntities() with:
this.QueryFilters.AddFilter((IQueryable<EmailMessageAddress> qFilter) => qFilter.Where(eMA => eMA.UserID.StartsWith("s")));
As for your questions:
a) you'd override the AuthorizeQuery method:
protected override bool AuthorizeQuery() {
if (this.Query.ElementType.ToString().Contains("__AnonymousType")) {
if (this.Query.QueryableType == typeof(MyUserEntity)) {
return false;
}
}
return base.AuthorizeQuery();
}
b) you can use what I suggested in my earlier post:
if (this.Query.ElementType.ToString().Contains("__AnonymousType")) {
FilterEmailMessageAddressEntities();
}
Again, this approach is not fail proof as one might (unlikely) create an entity containing "__AnonymousType" in it's name.
Regards,
Silvio.