Esempio n. 1
0
 /// <summary>
 /// Arrange db, controller, and collection
 /// </summary>
 public void SetUp()
 {
     context     = new LiteDBContext();
     genericRepo = new GenericRepo <TextureModel>(context);
     textures    = context.litedb.GetCollection <TextureModel>("textures");
     if (textures.Count() == 0)
     {
         context.LoadDefaultTextureDirectoryIntoDatabase(textures);
     }
     repo = new TextureRepo(context, genericRepo);
 }
Esempio n. 2
0
 public TextureRepo(LiteDBContext c, IGenericRepo <TextureModel> repository)
 {
     genericRepo = repository;
     context     = c;
     textures    = context.litedb.GetCollection <TextureModel>("textures");
     if (textures.Count() == 0)
     {
         context.LoadDefaultTextureDirectoryIntoDatabase(Textures);
     }
     for (int i = 1; i <= textures.Count(); i++)
     {
         var t = textures.FindById(i);
         genericRepo.Insert(t);
     }
 }
Esempio n. 3
0
 public EmpresaController(LiteDBContext db)
 {
     this.db = db;
 }
Esempio n. 4
0
 public GenericRepo(LiteDBContext c)
 {
     context    = c;
     collection = context.litedb.GetCollection <T>();
 }
Esempio n. 5
0
 public GenericRepo()
 {
     this.context = new LiteDBContext();
     collection   = context.litedb.GetCollection <T>();
 }
Esempio n. 6
0
 public UsuarioController(LiteDBContext db)
 {
     this.db = db;
 }
Esempio n. 7
0
 public RepositoryService(LiteDBContext db)
 {
     this._db = db;
 }