public UnitOfWork(
            WordPressDbContext context,
            //IOptions<AppSettings> appSettings,
            ITermRepository termRepository,
            MetadataRepository metadataRepository,
            IMetadataService metadataService,
            OptionRepository optionRepository,
            AttachmentRepository attachmentRepository,
            ILoggerFactory loggerFactory
            //IOptions<ClientSettings> clientSettings,
            //RazorViewRenderer razorView
            )
        {
            _context = context;
            _context.ChangeTracker.QueryTrackingBehavior = QueryTrackingBehavior.NoTracking;

            //AppSettings = appSettings.Value;
            Posts = new PostRepository(_context);
            //TermService = new TermService(termRepository, memoryCache);
            MetadataService = metadataService;
            TermTaxonomies  = new TermTaxonomyRepository(_context);
            Options         = new OptionRepository(_context);
            Attachments     = new AttachmentRepository(_context);
            //RazorView = razorView;
            // this must be last one so the all services are working in this service
        }
Exemple #2
0
 public DbContextHealthCheck(WordPressDbContext dbContext) => _dbContext = dbContext;