Skip to content

RepositoryBase - Add support for deferring save changes calls #23

@Psypher9

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    📋 Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions