Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge case: "The SqlParameter is already contained by another SqlParameterCollection." #106

Closed
adamskt opened this issue Dec 12, 2018 · 4 comments

Comments

@adamskt
Copy link
Member

adamskt commented Dec 12, 2018

This is a total edge-case, but I think it at least deserves some consideration or documentation. Here is an example project that illustrates the issue: https://github.com/IntelliTect/MarsError

Repro steps:

  • Set L42 to "WorkingConnection" in Startup.cs
  • It works (search for something on index page with two commonly-used letters)
  • Set L42 to "BrokenConnection" in Startup.cs
  • It breaks (search for something on index page with two commonly-used letters)

Intersection of characteristics to produce broken-ness:

  • MultipleActiveResultSets=true
  • Model has some kind of relationship
  • StandardDataSource impl overrides ApplyListSearchTerm with some usage of .FromSql and SqlParameters.
@adamskt
Copy link
Member Author

adamskt commented Dec 12, 2018

This might be related to dotnet/efcore#11370

@ascott18
Copy link
Collaborator

This has been fixed upstream in EF Core, per the issue you linked.

@adamskt
Copy link
Member Author

adamskt commented Jul 29, 2020

Shall I delete the referenced repro repo?

@ascott18
Copy link
Collaborator

That probably sounds OK. Note that I didn't actually test the repro repo using newer versions of EF core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants