コード例 #1
0
 public Country AddCountry(Country entity)
 {
     using (PropertyHubContext context = new PropertyHubContext())
     {
         context.Add(entity);
         context.SaveChanges();
     }
     return(entity);
 }
コード例 #2
0
 public Province AddProvince(Province entity)
 {
     using (PropertyHubContext context = new PropertyHubContext())
     {
         context.Entry(entity.Country).State = EntityState.Unchanged;
         context.Add(entity);
         context.SaveChanges();
     }
     return(entity);
 }
コード例 #3
0
 public City AddCity(City entity)
 {
     using (PropertyHubContext context = new PropertyHubContext())
     {
         context.Entry(entity.Province).State = EntityState.Unchanged;
         context.Add(entity);
         context.SaveChanges();
     }
     return(entity);
 }