public void Save(Task task) { var db = new LiteDbContext(); var collection = db.Context.GetCollection <Task>("tasks"); collection.Upsert(task); }
public List <Task> GetAllTasks() { var db = new LiteDbContext(); var collection = db.Context.GetCollection <Task>("tasks"); return(collection.FindAll().ToList()); }
public void Delete(ObjectId id) { var db = new LiteDbContext(); var collection = db.Context.GetCollection <Task>("tasks"); collection.Delete(c => c.Id == id); }
public BaseController(LiteDbContext context, IConfiguration configuration) { _configuration = configuration; _database = context.Context; int.TryParse(configuration["PageSize"], out _pageSize); }
public PlayerService(ILogger<PlayerService> logger, IHttpClientFactory clientFactory, LiteDbContext dbContext) { _logger = logger; _clientFactory = clientFactory; _database = dbContext; _random = new Random(); }
public BaseRepository(LiteDbContext context) { if (context == null) { throw new ArgumentNullException(nameof(context)); } this.context = context; }
public HomeController(LiteDbContext db) { //Primer insert que se realiza cuando se corre el programa this.db = db; var master = db.Context.GetCollection <Supermercado>("supermercado"); var supermercado = new Supermercado(); master.Insert(supermercado); }
// This method gets called by the runtime. Use this method to add services to the container. public IServiceProvider ConfigureServices(IServiceCollection services) { CoreState.AddContextWithSwagger(services, "http://172.17.9.105:1600/api", "postman", "postman", "postman"); services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2); ContainerBuilder builder = new ContainerBuilder(); services.AddCors(); Assembly assembly = typeof(IRepositoryCore <,>).Assembly; //builder.RegisterGeneric(typeof(IRepositoryCore<,>), assembly); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); // Assembly[] assemblies = GetYourAssemblies(); builder.RegisterGeneric(typeof(LiteRepository.Repository.LiteRepository <>)) .As(typeof(IRepositoryCore <,>)) .InstancePerLifetimeScope(); var lite = new LiteDbContext(); builder.RegisterInstance(lite).As <ILiteContext>(); Service.Start.Builder(builder); builder.Populate(services); Container = builder.Build(); return(new AutofacServiceProvider(Container)); }
public CajaController(LiteDbContext db) { this.db = db; }
//inyeccion del contexto de la base de datos public EmpleadoController(LiteDbContext db) { this.db = db; }
public UserDao(LiteDbContext con) { _userTable = con.Database.GetCollection <UserTable>(); }
public UserAvatarStorage(LiteDbContext liteDbContext) { this.liteDbContext = liteDbContext; }
public LiteDbUserStore(LiteDbContext dbContext) { _users = dbContext.LiteDatabase.GetCollection <TUser>("users"); _cancellationTokens = dbContext.LiteDatabase.GetCollection <CancellationToken>("cancellationtokens"); }
public void OnGet([FromServices] LiteDbContext db) { var bugs = db.Context.GetCollection <Bug>(); Bugs = bugs.FindAll(); }
public ArticuloController(LiteDbContext db) { this.db = db; }
public LiteDbRoleStore(LiteDbContext dbContext) { _roles = dbContext.LiteDatabase.GetCollection <TRole>("roles"); }
public HomeController(LiteDbContext context) { repo = context.LiteRepository; }
public KeyValuePairWithExpirationRepository(LiteDbContext context) : base(context) { }
public IncidentController(ILogger <IncidentController> logger, LiteDbContext db) { this.logger = logger; incidents = db.Context.GetCollection <Incident>(); }
public void OnGet([FromServices] LiteDbContext db) { var clientes = db.Context.GetCollection <Cliente>(); Clientes = clientes.FindAll(); }
public UserManagementRepository(IDomainEventPublisher eventPublisher, LiteDbContext dbContext) : base(eventPublisher, dbContext) { }
public HomeController(LiteDbContext db) { _db = db; }
public ProjectionDbSession(LiteDbContext context, TRepository repository) { Context = context; Repository = repository; }
public CapsStorage(LiteDbContext liteDbContext) { this.liteDbContext = liteDbContext; }
public CreateModel(LiteDbContext db) { _db = db; }
public APIController(LiteDbContext context, IConfiguration configuration) : base(context, configuration) { }
public AdapterRepository(LiteDbContext liteDb) { _liteDb = liteDb; }
public VideoDao(LiteDbContext con) { _videoTable = con.Database.GetCollection <VideoTable>(); }
public IndexModel(LiteDbContext db) { _db = db; }
public LiteDBDAL(LiteDbContext context) { _context = context.Context; }