4.5 beta: Linq query.IncludeFields gives error

I have the following linq statement that was correct in R# 4.1. In 4.5 however it gives error Cannot resolve symbol 'Guid'.
It does this for all calls to IncludeFields.


var


query = (ILLBLGenProQuery)(from i in metaData.Identification where i.SubscriberId == value.ID select i).IncludeFields(i=>i.Guid);



 

Regards,

Patrick

6 comments

Hello Patrick,

Could you please provide some information about types for this example? What is 'IncludeFields', the type of it's parameter, the type of qualifier expression, and what should be 'Guid'. Thank you for your request - looks very interesting.

Olga.

0

Hi Olga,

I am using O/R mapper LLBLGen Pro which has its own implementation of Linq.

Guid is a column in my database's data table Identification. The data table has been mapped to a class by LLBLGen pro which can be queried by the code I provided in my first post.
Here I only retrieve one column (Guid) instead of all columns which is the default when I do not use the IncludeFields() method.

The error however has something to do with the use of lambda expressions, because when I use R# to convert the lambda expression to a statement, the error disappears. When I again use R# to convert the statement back to a lambda expression, the error  reappears.

So the faulting statement was:
var
query = (ILLBLGenProQuery)(from i in metaData.Identification where i.SubscriberId == value.ID select i).IncludeFields(i=>i.Guid);

When I convert lambda expression to statement, the following statement does not give any error:

var query = (ILLBLGenProQuery)(from i in metaData.Identification where i.SubscriberId == value.ID select i).IncludeFields(i=> { return i.Guid; });

When I convert the statement back to a lambda expression, the statement gives an error again:
var
query = (ILLBLGenProQuery)(from i in metaData.Identification where i.SubscriberId == value.ID select i).IncludeFields(i=>i.Guid);


Kind regards,

Patrick

0

I have some additional info:

I just reloaded Visual Studio (after a crash ) and to my surprise R# marked the statement as an error.
When I converted the statement to a lambda expression, the error disappeared!
When I converted the lambda expression back to a statement, the error reappeared!

So now I have exactly the opposite behaviour as I described in my previous post!

0

Hello Patrick,

What if when error occures, you do insignificant change (type space) at the
file level, e.g. somewhere around type declaration or using directives?
What if after you convert the code and error disappears, you do the same
- make insignificant change at top level?

Thanks for your feedback!

Sincerely,
Ilya Ryzhenkov

JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"


IR> I have some additional info:
IR>
IR> I just reloaded Visual Studio (after a crash
IR> ) and to my surprise R# marked
IR> the statement as an error.
IR>
IR> When I converted the statement to a lambda expression, the error
IR> disappeared!
IR>
IR> When I converted the lambda expression back to a statement, the
IR> error reappeared!
IR>
IR> So this is exactly the opposite as I described in my previous post!
IR>
IR> ---
IR> Original message URL:
IR> http://www.jetbrains.net/devnet/message/5233920#5233920


0

Hi Ilya

When the error occurs and I type a space at top of the file (after the using directives) the error stays.
However, when I converted so that the error is gone and I then type a space the error reappears.

Hope this helps,

Kind regards,

Patrick

0

Please sign in to leave a comment.