示例#1
0
 public List <Province> GetProvinces()
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from pro in _context.Provinces select pro).ToList());
     }
 }
示例#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());
     }
 }
示例#3
0
 public List <Country> GetCountries()
 {
     using (DemoContaxt _context = new DemoContaxt())
     {
         return((from c in _context.Countries select c).ToList());
     }
 }
示例#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());
     }
 }
示例#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());
     }
 }