Issue with 6.50.x LINQ queries

Issue with 6.50.x LINQ queries

Postby johnb » Sun 16 Oct 2011 23:08

I recently upgraded from 6.30.165 to 6.50.228 and started getting some strange behaviour. As a result i have had to revert back to 6.30.165 to satbise function and have things work as expected.

The first issue was on subsequent calls the query was failing to return a result with FirstOrDefault even though there is something in the result set and you can get the value using a .ToList()[0].

My query was below. IF i just executed the the query and put a countr on it would return 1. If is did a tolist i got one record. Just the firstordefault failed and return null.

Code: Select all
                    var _jobAEsandaStatesClaimant1 =
                        (from JobAEsandaState in _AIMSContext.JobAEsandaStates
                         where JobAEsandaState.Statekey == _claimant1State
                         select JobAEsandaState).FirstOrDefault();

I then reverted back to 6.50.214 and had another strange issue in teh the query result appeard to be being cached and was getting the same result as the first call even though the query parameters had changed.

My query was below. The same jobid was always returned the one that was first called even though the cleintref was different

Code: Select all
                    var _result =
                        from Job in _AIMSContext.Jobs
                        where Job.ClientRef1.IndexOf(ClientRef, StringComparison.OrdinalIgnoreCase) >= 0
                        || Job.ClientRef2.IndexOf(ClientRef, StringComparison.OrdinalIgnoreCase) >= 0
                        || Job.ClientRef3.IndexOf(ClientRef, StringComparison.OrdinalIgnoreCase) >= 0
                        select Job.JobId;

All very strange but please it is now working as expected in 6.30.165. It is very strange and expect if these linq queries werent working then there would be others.

Hope this helps. You help would be much appreaciated.

Posts: 6
Joined: Tue 25 May 2010 15:02

Postby StanislavK » Mon 24 Oct 2011 16:07

We have released new build 6.50.237 of dotConnect for MySQL, which includes the fix for the query caching issue. The build can be downloaded from
(the trial and free versions) or from Registered Users' Area (for users with active subscription only).
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Return to dotConnect for MySQL