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

Batch delete and batch update without batching? #642

Closed
RudeySH opened this issue Oct 6, 2020 · 4 comments
Closed

Batch delete and batch update without batching? #642

RudeySH opened this issue Oct 6, 2020 · 4 comments
Assignees

Comments

@RudeySH
Copy link

RudeySH commented Oct 6, 2020

Is it possible to use .Delete() or .Update(x => ...) without the batching? I would like to be able to delete or update entities without loading them into memory, but I don't want EFPlus to generate a query that will perform a batch delete/update with a loop.

@JonathanMagnan JonathanMagnan self-assigned this Oct 7, 2020
@JonathanMagnan
Copy link
Member

Hello @RudeySH ,

Are you using EF6 or EF Core? We will look at it.

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

@JonathanMagnan
Copy link
Member

We quickly looked at the code, if you use EF Core that's already possible by setting the BatchSize = 0.

Could you look at it and let me know if that work for you?

@RudeySH
Copy link
Author

RudeySH commented Oct 7, 2020

I'm using EF6. I couldn't find any documentation on BatchSize = 0, so I'm not sure if this also works for EF6.

@JonathanMagnan
Copy link
Member

Hello @RudeySH ,

A new version is available (v1.12.37),

We added the support to BatchSize = 0 for EF6 to avoid creating a batch size

context.EntitySimples.Delete(option => option.BatchSize = 0);

Let me know if that was what you were looking for.

Best Regards,

Jon

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