/// <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); }
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); } }
public EmpresaController(LiteDBContext db) { this.db = db; }
public GenericRepo(LiteDBContext c) { context = c; collection = context.litedb.GetCollection <T>(); }
public GenericRepo() { this.context = new LiteDBContext(); collection = context.litedb.GetCollection <T>(); }
public UsuarioController(LiteDBContext db) { this.db = db; }
public RepositoryService(LiteDBContext db) { this._db = db; }