public void UpdateCity(City city) { City c = context.Cities.Find(city.Id); if (c != null) { context.Entry(c).State = EntityState.Modified; context.SaveChanges(); } }
public long InsertCity(City city) { context.Cities.Add(city); context.SaveChanges(); return city.Id; }