Esempio n. 1
0
 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();
     }
 }
Esempio n. 2
0
 partial void DeleteCDCatalogEntity(CDCatalogEntity instance);
Esempio n. 3
0
 partial void UpdateCDCatalogEntity(CDCatalogEntity instance);
Esempio n. 4
0
 partial void InsertCDCatalogEntity(CDCatalogEntity instance);
Esempio n. 5
0
 private void detach_CDCatalogEntities(CDCatalogEntity entity)
 {
     this.SendPropertyChanging();
     entity.Person = null;
 }