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.
John