Exemple #1
0
        public ArticlesControllerTests()
        {
            _connection = new SqliteConnection("DataSource=:memory:");
            _connection.Open();

            options = new DbContextOptionsBuilder <CrossBlogDbContext>()
                      .UseSqlite(_connection)
                      .Options;

            using (var context = new CrossBlogDbContext(options))
            {
                context.Database.EnsureCreated();
            }

            _context = new CrossBlogDbContext(options);

            _articlesController = new ArticlesController(new ArticleRepository(_context));
        }
 public ArticleRepository(CrossBlogDbContext dbContext) : base(dbContext)
 {
 }
 public BlogDbInitializer(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #4
0
 public CommentRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #5
0
 public DatabaseSeeder(CrossBlogDbContext context)
 {
     _context = context;
 }
Exemple #6
0
 public AuthorRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
 public MediaArticleRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #8
0
 public CommentRepository(CrossBlogDbContext dbContext) : base(dbContext)
 {
 }
Exemple #9
0
 public TagRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #10
0
 protected GenericRepository(CrossBlogDbContext dbContext)
 {
     DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
 }
Exemple #11
0
 public ConfigurationRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemple #12
0
 public CategoryRepository(CrossBlogDbContext dbContext)
 {
     _dbContext = dbContext;
 }