Ejemplo n.º 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new LojasContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <LojasContext> >()))
            {
                // Look for any Lojas.
                // if (context.Loja.Any())
                // {
                //     return;   // DB has been seeded
                // }

                // context.Loja.AddRange(
                //     new Loja
                //     {
                //         Title = "When Harry Met Sally",
                //         ReleaseDate = DateTime.Parse("1989-2-12"),
                //         Genre = "Romantic Comedy",
                //         Price = 7.99M
                //     }
                // );
                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public EstoqueController(LojasContext context)
 {
     _context = context;
 }
Ejemplo n.º 3
0
 public ProdutoPedidoController(LojasContext context)
 {
     _context = context;
 }
Ejemplo n.º 4
0
 public EntregaController(LojasContext context)
 {
     _context = context;
 }
Ejemplo n.º 5
0
 public LojaController(LojasContext context)
 {
     _context = context;
 }