There is nothing wrong with the code. If Query.Load() is returning true then it found the record. Also, I would improve your query like this:
OLD: sampleTray.Query.Where(sampleTray.Query.TrayNumber.Equal(trayNmber))
NEW: sampleTray.Query.Where(sampleTray.Query.TrayNumber == trayNmber)
We support all of the natural language operators and it makes your query much easier to read.
Why aren't you using an Identity column for this? I'm not sure what the issue really is or why you say "you are not getting the results as you expected" ?
EntitySpaces |
Twitter |
BLOG | Please honor our Software License