//Obtener un municipio por ID public Cat_Municipio getMunicipio(int id) { Cat_Municipio proveedor = new Cat_Municipio(); proveedor = db.Cat_Municipios.SingleOrDefault(p => p.id_municipio == id); return(proveedor); }
//Constructor public ModeloCRUD() { empleado = new Employee(); producto = new Product(); categoria = new Category(); proveedor = new Supplier(); estado = new Cat_Estado(); municipio = new Cat_Municipio(); listaEmpleados = new List <Employee>(); listaProductos = new List <Product>(); listaCategorias = new List <Category>(); listaProveedores = new List <Supplier>(); listaEstados = new List <Cat_Estado>(); listaMunicipios = new List <Cat_Municipio>(); }