private static InfoCovidDbContext GetDbContext()
        {
            var builder = new DbContextOptionsBuilder <InfoCovidDbContext>();

            builder.UseInMemoryDatabase("covidinfo");
            var options = builder.Options;

            var context = new InfoCovidDbContext(options);

            if (context.CasosCovid.Count() == 0)
            {
                context.AddRange(CasosCovidData.GetFakeCasos());
                context.SaveChanges();
            }

            return(context);
        }
Пример #2
0
 public ReporteCasoController(InfoCovidDbContext context)
 {
     _context = context;
 }
Пример #3
0
 public CasosCovidController(InfoCovidDbContext context)
 {
     _context = context;
 }