Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
 public SkillRepository(DataLayerInfrastructure <ContactsContext> infrastructure) : base(infrastructure)
 {
 }
Exemplo n.º 4
0
 protected BaseRepository(DataLayerInfrastructure <ContactsContext> infrastructure)
 {
     DatabaseContext = infrastructure.GetDbContext();
 }
Exemplo n.º 5
0
 public SkillRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure) : base(infrastructure)
 {
 }
Exemplo n.º 6
0
 public ContactRepository(DataLayerInfrastructure <ContactsContext> infrastructure) : base(infrastructure)
 {
     _database = (ContactsContext)DatabaseContext;
 }
Exemplo n.º 7
0
 protected BaseRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure)
 {
     DatabaseContext = infrastructure.GetDbContext();
     _liteCollection = DatabaseContext.GetCollection <T>();
 }
Exemplo n.º 8
0
 public ContactRepository(DataLayerInfrastructure <ILiteDatabase> infrastructure) : base(infrastructure)
 {
     _database = DatabaseContext;
 }