public static void InitDb(TestContext context) { _infrastructure = new Infrastructure(); //Prepare a dummy config for the temporary db file IConfigurationBuilder configurationBuilder = new ConfigurationBuilder() .AddInMemoryCollection(new List <KeyValuePair <string, string> >() { }); IConfiguration config = configurationBuilder.Build(); _infrastructure.EnsureStorageCreated(config); }
public static void InitDb(TestContext context) { _infrastructure = new Infrastructure(); _tempDbFilename = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.db"); //Prepare a dummy config for the temporary db file IConfigurationBuilder configurationBuilder = new ConfigurationBuilder() .AddInMemoryCollection(new List <KeyValuePair <string, string> >() { new KeyValuePair <string, string>("litedb-path", _tempDbFilename) }); IConfiguration config = configurationBuilder.Build(); _infrastructure.EnsureStorageCreated(config); _repo = new ContactRepository(_infrastructure); }
public SkillRepository(DataLayerInfrastructure <ContactsContext> infrastructure) : base(infrastructure) { }
protected BaseRepository(DataLayerInfrastructure <ContactsContext> infrastructure) { DatabaseContext = infrastructure.GetDbContext(); }
public SkillRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure) : base(infrastructure) { }
public ContactRepository(DataLayerInfrastructure <ContactsContext> infrastructure) : base(infrastructure) { _database = (ContactsContext)DatabaseContext; }
protected BaseRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure) { DatabaseContext = infrastructure.GetDbContext(); _liteCollection = DatabaseContext.GetCollection <T>(); }
public ContactRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure) : base(infrastructure) { _database = DatabaseContext; }