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

Bulk operations applied to wrong schema #785

Open
vtkachen111 opened this issue Nov 14, 2023 · 0 comments
Open

Bulk operations applied to wrong schema #785

vtkachen111 opened this issue Nov 14, 2023 · 0 comments
Assignees

Comments

@vtkachen111
Copy link

Here is what to include in your request to make sure we implement a solution as quickly as possible.

1. Description

I have a situation where in one database I have multiple schemas. So for example, I have 2 applications that use 1 database, however, each application has its own schema, with same object types.
Example:

[Applciation1].[Users]
[Application2].[Users].

I have run into a situation where I am using linq dbcontext for application2, I write a query to delete a user. Something like the following
Context2.Users.Where(u => u.Name == “uname2”).Delete()

If evaluating the query: Context2.Users.Where(u => u.Name == “uname2”).Tolist() it retrieves the correct user, however, once your delete() or update() method is run, it updates/deletes user with he same Id from [Application1].[Users]
I was previously using EntityFramework.Extensions (the deprecated one) and it didn’t have this issue, however, with this one the issue exists.

I am using ef6, with ms sql database.

3. Fiddle or Project

If you are able,

Provide a Fiddle that reproduce the issue: https://dotnetfiddle.net/4SeLq9

Or provide a project/solution that we can run to reproduce the issue.

  • Make sure the project compile
  • Make sure to provide only the code that is required to reproduce the issue, not the whole project
  • You can send private code here: [email protected]

Otherwise, make sure to include as much information as possible to help our team to reproduce the issue.

4. Any further technical details

Add any relevant detail can help us.

Further technical details

  • EF version: [EF 6]
  • EF Plus version: [z.EntityFramework.Plus.ef6 v7.100.0.0]
  • Database Server version: [SQL Server 15.0.2104]
  • Database Provider version (NuGet): [Microsoft.Data.SqlClient v5.1.2]
@JonathanMagnan JonathanMagnan self-assigned this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants