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

RepositoryBase - Add support for deferring save changes calls #23

Open
Psypher9 opened this issue Sep 30, 2022 · 1 comment
Open

RepositoryBase - Add support for deferring save changes calls #23

Psypher9 opened this issue Sep 30, 2022 · 1 comment
Labels
Milestone

Comments

@Psypher9
Copy link
Member

When working with Entity Framework or EntityFramework Core, there needs to be a way to skip the implicit call to SaveChanges or SaveChangesAsync

Proposed options:

Option 1 - New IImmediateRepository and IReadOnlyImmediateRepository interfaces to support the immediate save changes

Example:

// currently
await _thingsRepo.AddAsync(newThing);

// instead
await _thingsRepo.AddImmediateAsync(newThing);

Where the existing methods will not immediately call for SaveChanges until UpdateAsync is called

Option 2 - optional parameter to apply immediately

// currently applying immediately
await _thingsRepo.AddAsync(newThing);

await _thingsRepo.AddAsync(newThing, applyImmediately: true);
@Psypher9 Psypher9 added this to the 4.0.0 milestone Sep 30, 2022
@Psypher9 Psypher9 added the ef label Sep 30, 2022
@Psypher9 Psypher9 moved this to 📋 Backlog in Basic Repos Apr 11, 2023
@Psypher9
Copy link
Member Author

Option 2 seems to be looking better to me right about now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant