Ejemplo n.º 1
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new MtG_DecktesterContext(
                serviceProvider.GetRequiredService <
                    DbContextOptions <MtG_DecktesterContext> >()))
     {
         context.Database.Migrate(); // Creates database if not exist
     }
 }
Ejemplo n.º 2
0
        // GET: Cards
        public async Task <IActionResult> Index()
        {
            //Count number of cards
            MtG_DecktesterContext context = new MtG_DecktesterContext();
            int nCards = _context.Card.Count();

            ViewBag.TotalCards = nCards;

            return(View(await _context.Card.ToListAsync()));
        }
Ejemplo n.º 3
0
 public CardsController(MtG_DecktesterContext context)
 {
     _context = context;
 }