Skip to content

RepositoryBase - Add support for deferring save changes calls #23

Description

@Psypher9

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);

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions