Ejemplo n.º 1
0
 public List <Province> GetProvinces()
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from pro in _context.Provinces select pro).ToList());
     }
 }
Ejemplo n.º 2
0
 public Country GetCountry(int id)
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from c in _context.Countries where c.Id == id select c).FirstOrDefault());
     }
 }
Ejemplo n.º 3
0
 public List <Country> GetCountries()
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from c in _context.Countries select c).ToList());
     }
 }
Ejemplo n.º 4
0
 public List <City> GetCities(Province province)
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from citi in _context.Cities
                 .Include("Province.Country")
                 where citi.Province.Id == province.Id
                 select citi).ToList());
     }
 }
Ejemplo n.º 5
0
 public List <Province> GetProvinces(Country country)
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from p in _context.Provinces
                 .Include("Country")
                 where p.Country.Id == country.Id
                 select p).ToList());
     }
 }