Beispiel #1
0
        private static void AddTestData(maqUbiContext context)
        {
            context.Cliente.Add(new Cliente {
                id = 1, nombre = "Cliente Test 1"
            });
            context.Cliente.Add(new Cliente {
                id = 2, nombre = "Cliente Test 2"
            });
            context.Cliente.Add(new Cliente {
                id = 3, nombre = "Cliente Test 3"
            });
            context.Cliente.Add(new Cliente {
                id = 4, nombre = "Cliente Test 4"
            });

            context.Ubicacion.Add(new Ubicacion {
                id = 1, ubicacion = "Ubicacion Test 1", idCliente = 1
            });
            context.Ubicacion.Add(new Ubicacion {
                id = 2, ubicacion = "Ubicacion Test 2", idCliente = 2
            });
            context.Ubicacion.Add(new Ubicacion {
                id = 3, ubicacion = "Ubicacion Test 3", idCliente = 3
            });
            context.Ubicacion.Add(new Ubicacion {
                id = 4, ubicacion = "Ubicacion Test 4", idCliente = 4
            });

            context.Maquina.Add(new Maquina {
                id = 1, modelo = "Modelo 1", nSerie = "123456", tipo = "Tipo 1", idCliente = 1, idUbicacion = 1
            });
            context.Maquina.Add(new Maquina {
                id = 2, modelo = "Modelo 2", nSerie = "98745z", tipo = "Tipo 2", idCliente = 2, idUbicacion = 2
            });
            context.Maquina.Add(new Maquina {
                id = 3, modelo = "Modelo 3", nSerie = "79813w", tipo = "Tipo 3", idCliente = 3, idUbicacion = 3
            });
            context.Maquina.Add(new Maquina {
                id = 4, modelo = "Modelo 4", nSerie = "36985t", tipo = "Tipo 4", idCliente = 4, idUbicacion = 4
            });

            context.SaveChanges();
        }
Beispiel #2
0
 public MaquinaController(maqUbiContext context)
 {
     _context = context;
 }
 public ClientesController(maqUbiContext context)
 {
     _context = context;
 }
 public UbicacionController(maqUbiContext context)
 {
     _context = context;
 }