Example #1
0
        public void UpdateCity(City city)
        {
            City c = context.Cities.Find(city.Id);

            if (c != null)
            {
                context.Entry(c).State = EntityState.Modified;
                context.SaveChanges();
            }
        }
Example #2
0
        public long InsertCity(City city)
        {
            context.Cities.Add(city);
            context.SaveChanges();

            return city.Id;
        }