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

SharedTypeEntity don't work with bulk operations #1520

Open
paulrostorp opened this issue Jun 24, 2024 · 0 comments
Open

SharedTypeEntity don't work with bulk operations #1520

paulrostorp opened this issue Jun 24, 2024 · 0 comments

Comments

@paulrostorp
Copy link

paulrostorp commented Jun 24, 2024

var entityType = type is null ? null : context.Model.FindEntityType(type);
if (entityType == null)
{
type = entities.FirstOrDefault()?.GetType() ?? throw new ArgumentNullException(nameof(type));
entityType = context.Model.FindEntityType(type);
HasAbstractList = true;
}
if (entityType == null)
{
throw new InvalidOperationException($"DbContext does not contain EntitySet for Type: {type?.Name}");
}

The usage of FindEntityType breaks bulk operations on SharedTypeEntity.

Possible solutions:

  1. Allow passing a specific IEntityType via parameters or bulkconfig
  2. Allow running bulk methods on a specific DB Set instead of just the context; this aligns with official EF core behavior: https://learn.microsoft.com/en-us/ef/core/change-tracking/miscellaneous#dbcontext-versus-dbset-methods
@paulrostorp paulrostorp changed the title SharedTypeEntity don't work SharedTypeEntity don't work with bulk operations Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant