New Posts New Posts RSS Feed: Server Query Filtering
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Server Query Filtering

 Post Reply Post Reply
Author
jsobell View Drop Down
Groupie
Groupie
Avatar

Joined: 02-Apr-2009
Location: Australia
Posts: 80
Post Options Post Options   Quote jsobell Quote  Post ReplyReply Direct Link To This Post Topic: Server Query Filtering
    Posted: 18-Jun-2009 at 6:15am
Thanks Kim,
The problem was that the default namespace contained the MS generated entities as well as IdeaBlade's, so it was grabbing the wrong ones by default.

Cheers,
  Jason
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 17-Jun-2009 at 8:18pm

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.
 
Back to Top
heyyou View Drop Down
Newbie
Newbie
Avatar

Joined: 16-Jun-2009
Location: Melbourne
Posts: 5
Post Options Post Options   Quote heyyou Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jun-2009 at 6:50pm
Hi
 
According to the examples I've seen, if I am implementing the IEntityServerFetching interface, the following code should be correct, however, I get a compile time error
 
var query = args.Query as EntityQuery<Client>;
query.Filter((IQueryable<Client> cl) => cl.Where(fc => fc.DeleteDate == null));
 
with the error being
Error 19 The type 'MyApp.Web.Client' cannot be used as type parameter 'T2' in the generic type or method 'IdeaBlade.EntityModel.EntityQueryExtensions.Filter<T1,T2>(IdeaBlade.EntityModel.EntityQuery<T1>, System.Func<System.Linq.IQueryable<T2>,System.Linq.IQueryable<T2>>)'. There is no implicit reference conversion from 'MyApp.Web.Client' to 'IdeaBlade.EntityModel.Entity'. 
 
Client is one of the entities mapped in the Object mapper
 
Can anyone suggest to me what is not correct here?
 
Regards
Stuart
 
 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down