public void AddContent(IEnumerable <IPerson> persons) { foreach (IPerson _item in persons) { Person _newPerson = new Person() { FirstName = _item.FirstName, LastName = _item.LastName, Age = _item.Age }; this.Persons.InsertOnSubmit(_newPerson); foreach (ICDCatalog _cdEntity in _item.CDs) { CDCatalogEntity _newEntity = new CDCatalogEntity() { Title = _cdEntity.Title, Person = _newPerson, Country = _cdEntity.Country, Price = _cdEntity.Price, Year = (short)_cdEntity.Year }; this.CDCatalogEntities.InsertOnSubmit(_newEntity); } this.SubmitChanges(); } }
partial void DeleteCDCatalogEntity(CDCatalogEntity instance);
partial void UpdateCDCatalogEntity(CDCatalogEntity instance);
partial void InsertCDCatalogEntity(CDCatalogEntity instance);
private void detach_CDCatalogEntities(CDCatalogEntity entity) { this.SendPropertyChanging(); entity.Person = null; }