Exemplo n.º 1
0
        public DetalleCarroController(AutoloteDataContext context, DetalleCarroAppService detalleCarroAppService)
        {
            _baseDatos = context;
            _detalleCarroAppService = detalleCarroAppService;

            if (_baseDatos.DetalleCarros.Count() == 0)
            {
                _baseDatos.DetalleCarros.Add(new DetalleCarro {
                    Fecha = 2020, Motor = "3.5", Cilindraje = "v8"
                });
                _baseDatos.DetalleCarros.Add(new DetalleCarro {
                    Fecha = 2020, Motor = "3.5", Cilindraje = "v8"
                });
                _baseDatos.DetalleCarros.Add(new DetalleCarro {
                    Fecha = 2019, Motor = "3.0", Cilindraje = "v6"
                });
                _baseDatos.DetalleCarros.Add(new DetalleCarro {
                    Fecha = 2018, Motor = "2.5", Cilindraje = "v6"
                });
                _baseDatos.DetalleCarros.Add(new DetalleCarro {
                    Fecha = 2017, Motor = "2.0", Cilindraje = "v4"
                });

                _baseDatos.SaveChanges();
            }
        }
Exemplo n.º 2
0
        public AutoloteController(AutoloteDataContext context, AutoloteAppService autoloteAppService)
        {
            _baseDatos          = context;
            _autoloteAppService = autoloteAppService;

            if (_baseDatos.Carros.Count() == 0)
            {
                _baseDatos.Carros.Add(new Carro {
                    Marca = "Toyora", Modelo = "Land-Cruiser", Color = "Rojo vino", DetalleCarroid = 1
                });
                _baseDatos.Carros.Add(new Carro {
                    Marca = "Nissan", Modelo = "NP-300", Color = "Azul", DetalleCarroid = 2
                });
                _baseDatos.SaveChanges();
            }
        }