neisbut / EntityFramework.MemoryJoin

Extension for EntityFramework for joins to in-memory data
MIT License
56 stars 24 forks source link

Support multiple memory joins for EF Core #16

Closed mrbucurie closed 3 years ago

mrbucurie commented 3 years ago

When using join with multiple local lists I get the following error: The variable name '@__gen_q_p0' has already been declared. Variable names must be unique within a query batch or stored procedure.

I managed to track it down to the fact the MappingHelper.AppendRowsAsValues always starts numbering the parameters from 0. I believe it should be made possible (as an overload perhaps) to pass somehow a reference index that can be used and incremented in there. This would definitely solve the problem; what do you think?

neisbut commented 3 years ago

Hi @mrbucurie, sorry for so late answer (pretty hard times you know..). Thanks for reporting this, I fixed it in 0.7.5 release, please check when possible.

mrbucurie commented 3 years ago

It's working fine, thank you! I see you have added a static "parametersSequence". With long running processes this will become an issue in about 68 years of continuous execution... Because of the overflow, the number will become negative and hence an invalid parameter name.