Specified Method Not Supported

46 views
Skip to first unread message

Arman

unread,
Sep 27, 2012, 10:20:51 AM9/27/12
to nhu...@googlegroups.com
With Nhibernate 3.3.1.4000 and Fluent Nhibernate 1.3 , use code like this :

        var query = from Person person in Session.Query<Person> select person;
        var query2 = from Person person in query select person;

you will get "Specified Method not supported" Exception. BUT if you change them to this, it works :

        var query = from person in Session.Query<Person> select person;
        var query2 = from person in query select person;

i mean if you specify the class type in linq query on query variable , Nhibernate cannot run the query, but if you remove it's type, it can be run.



Arman

unread,
Oct 9, 2012, 4:42:53 AM10/9/12
to nhu...@googlegroups.com
is there anybody who can help me ?

Ramon Smits

unread,
Oct 9, 2012, 9:42:55 AM10/9/12
to nhu...@googlegroups.com
I don't really understand your problem. You query for Person and then again for person. 

Aren't you just forgetting the round brackets after Query<Person> ?

Why do you need to specify the type? Isn't the result typed by default?

-- Ramon



--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/JO-gqbyedKUJ.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.

Arman

unread,
Oct 9, 2012, 10:00:34 AM10/9/12
to nhu...@googlegroups.com
This is not a real case.
this is just my way to show you what the problem is.

The problem is lay down under specifying Linq Variable type in Linq query. 



On Thursday, September 27, 2012 5:50:51 PM UTC+3:30, Arman wrote:

Fran Knebels

unread,
Oct 9, 2012, 10:22:03 AM10/9/12
to nhu...@googlegroups.com
I'm not sure I understand.

All linq variables are already strongly typed.  There is no need to declare from Person person, because the compiler is taking the type from your Session.Query<Person>.  it knows you are querying a strongly typed list of Persons so the type of person must be Person.

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/Enfgaeth8mIJ.

Arman

unread,
Oct 9, 2012, 10:25:56 AM10/9/12
to nhu...@googlegroups.com
Yeah, thats correct.
so if i explicitly state the variable type, it should not be any problem. but it is a problem.

somebody should check this case with nhibernate sourcecode or state a bug for them to chechk it. 

To unsubscribe from this group, send email to nhusers+unsubscribe@googlegroups.com.

Oskar Berggren

unread,
Oct 9, 2012, 11:01:22 AM10/9/12
to nhu...@googlegroups.com


2012/10/9 Arman <arman....@gmail.com>

Yeah, thats correct.
so if i explicitly state the variable type, it should not be any problem. but it is a problem.

somebody should check this case with nhibernate sourcecode or state a bug for them to chechk it. 

You can report it here:
https://nhibernate.jira.com/browse/NH

Please include full exception details and a test case. See http://nhforge.org/blogs/nhibernate/archive/2008/10/04/the-best-way-to-solve-nhibernate-bugs-submit-good-unit-test.aspx for help with that. You can also fork NHibernate on github, create a branch for the issue and submit a pull request with the test case.

/Oskar


Alexander I. Zaytsev

unread,
Oct 12, 2012, 9:55:07 AM10/12/12
to nhu...@googlegroups.com
Hi,

It should be fixed with latest trunk already. 


Best Regards, Alex

2012/10/9 Oskar Berggren <oskar.b...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To post to this group, send email to nhu...@googlegroups.com.
To unsubscribe from this group, send email to nhusers+u...@googlegroups.com.

Alexander I. Zaytsev

unread,
Oct 12, 2012, 9:56:09 AM10/12/12
to nhu...@googlegroups.com
Hi,

It should be fixed with latest trunk already. 


Best Regards, Alex

2012/9/27 Arman <arman....@gmail.com>

--
You received this message because you are subscribed to the Google Groups "nhusers" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nhusers/-/NQEZ106-MaMJ.
Reply all
Reply to author
Forward
0 new messages