心澄欲遣

不践迹,亦不入于室

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
  // Read Repository.
    public interface IUserReadRepository : IReadOnlyRepository<AppUser, Guid>
    {
    }

    // Assign DbContext.
    public class UserReadRepository : EfCoreRepository<ReadDbContext, AppUser, Guid>, IUserReadRepository
    {
        public UserReadRepository(IDbContextProvider<ReadDbContext> dbContextProvider) : base(dbContextProvider)
        {
            
        }
    }
    
    // Write Repository.
    public interface IUserWriteRepository : IRepository<AppUser, Guid>
    {
    }

    // Assign DbContext.
    public class UserWriteRepository : EfCoreRepository<WriteDbContext, AppUser, Guid>, IUserReadRepository
    {
        public UserWriteRepository(IDbContextProvider<WriteDbContext> dbContextProvider) : base(dbContextProvider)
        {
            
        }
    }

 

posted on 2022-01-10 09:05  心澄欲遣  阅读(140)  评论(0编辑  收藏  举报
欢迎第myspace graphics个访客