Beispiel #1
0
        public void Delete(Section.Contract.Section section)
        {
            Entities.Section dbSection = dbSet.Find(section.ID);

            if (dbSection != null)
            {
                dbSet.Remove(dbSection);
            }
        }
Beispiel #2
0
        public void Upsert(Section.Contract.Section section)
        {
            Entities.Section existingSection = dbSet.Find(section.ID);

            if (existingSection == null)
            {
                dbSet.Add(section.DeepCopyTo <Entities.Section>());
            }
            else
            {
                Mapper.Map(section, existingSection);
            }
        }