public Country Add(Country entity) { if (entity.Id > 0) return entity; context.Country.AddObject(entity); try { context.SaveChanges(); } catch (OptimisticConcurrencyException e) { //An optimistic concurrency violation has occurred in the data source. throw new ConcurrencyException(e.Message); } return entity; }
public Country Update(Country entity) { return entity; }
public void Delete(Country entity) { context.DeleteObject(entity); }
private void FixupCountry(Country previousValue) { if (previousValue != null && previousValue.Address.Contains(this)) { previousValue.Address.Remove(this); } if (Country != null) { if (!Country.Address.Contains(this)) { Country.Address.Add(this); } if (Country_id != Country.Id) { Country_id = Country.Id; } } }