public void Delete(DalSection entity) { var section = entity.ToSection(); section.Categories = _categoryRepository.GetCategoriesBySectionId(entity.Id).ToCategoryCollection(); section = _dbContext.Set<Section>().Single(s => s.SectionId == section.SectionId); _dbContext.Set<Section>().Remove(section); }
public void Create(DalSection entity) { var section = entity.ToSection(); section.SectionId = 0; _dbContext.Set<Section>().Add(section); }