private bool OnCountryPersonViaCountryCollectionAdding(Country instance, Person item) { if ((object)this != (object)item.Context) { throw PersonCountryDemoContext.GetDifferentContextsException("item"); } return(true); }
private bool OnPersonCountryChanging(Person instance, Country newValue) { if ((object)newValue != null) { if ((object)this != (object)newValue.Context) { throw PersonCountryDemoContext.GetDifferentContextsException(); } } return(true); }
private static ArgumentException GetDifferentContextsException() { return(PersonCountryDemoContext.GetDifferentContextsException("value")); }