New Posts New Posts RSS Feed: AsScalarAsync for ITypedQuery?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

AsScalarAsync for ITypedQuery?

 Post Reply Post Reply
Author
stephenmcd1 View Drop Down
DevForce MVP
DevForce MVP


Joined: 27-Oct-2009
Location: Los Angeles, CA
Posts: 166
Post Options Post Options   Quote stephenmcd1 Quote  Post ReplyReply Direct Link To This Post Topic: AsScalarAsync for ITypedQuery?
    Posted: 20-Apr-2011 at 11:22am
Currently, it looks like AsScalarAsync can only be used with IEntityQuery<T>s.  I'm trying to find a way to use it for an ITypedQuery that was created dynamically.  For example, the following code works fine:

var q1 = em.GetQuery<User>();
q1.AsScalarAsync().Count(CallbackMethod);

But I want the query's type to be dynamic.  This is the code I want to write but can't:

var type = typeof (User);//In the real use, this type won't be hardcoded
var q2 = EntityQuery.Create(type);
q2.AsScalarAsync().Count(CallbackMethod); //Error: AsScalarAsync can't be used on q2.

Are there any plans to support AsScalarAsync for ITypedQueries?  Or will I need to do some tricky reflection/casting to get this to work?

Thanks,
-Stephen
Back to Top
DenisK View Drop Down
IdeaBlade
IdeaBlade


Joined: 25-Aug-2010
Posts: 715
Post Options Post Options   Quote DenisK Quote  Post ReplyReply Direct Link To This Post Posted: 20-Apr-2011 at 8:23pm
Hi stephenmcd1;

This is planned to be supported in 6.1.0 release which is scheduled for sometime in early to mid May. We have a 6.1.0 EAP that already supports this. Please let me know if you wish to download it.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down