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

Add two methods for consuming repositories in scenarios where repositories could be longer lived (e.g. Blazor component Injections) #289

Merged
merged 4 commits into from
Apr 11, 2023

Commits on Aug 20, 2022

  1. Add two methods for consuming repositories in scenarios where reposit…

    …ories could be longer lived (e.g. Blazor component Injections)
    
    - BREAKING CHANGE - requires support for netstandard2.0 to be dropped from Ardalis.Specification.EntityFrameworkCore.csproj in order to make use of IDbContextFactory
    - Add IRepositoryFactory interface and EFRepositoryFactory concrete implementation to encapsulate the 'Unit of Work' principle at the repository level, consuming DbContextFactories from DI containers such as those added using the .AddDbContextFactory method, following blazor best practices for managing DbContext lifetimes
    - Add ContextFactoryRepositoryBaseOfT.cs abstract implementation of IRepositoryBase<T> which again consumes DbContextFactories from DI containers such as those added using the .AddDbContextFactory method but creates a new instance of the DbContext for every method call in the repository. This breaks Entity Framework change tracking so Update and Delete methods will have to be overloaded in concrete implementations using the TrackChanges method on the context.
    jasonsummers committed Aug 20, 2022
    Configuration menu
    Copy the full SHA
    32dc155 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2022

  1. Configuration menu
    Copy the full SHA
    cb4c9d0 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2022

  1. Configuration menu
    Copy the full SHA
    78a2361 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2022

  1. Add more integration tests for ContextFactoryRepositoryBaseOfT and te…

    …sts for EFRepositoryFactory
    jasonsummers committed Oct 16, 2022
    Configuration menu
    Copy the full SHA
    79617dd View commit details
    Browse the repository at this point in the history