public void Add(Section entity)
 {
     CheckValidity(entity);
     db.Sections.Add(entity);
     Commit();
 }
        public void Update(int id, Section entity)
        {
            CheckValidity(entity);

            var section = GetById(id);

            section.Name = entity.Name;
            section.Note = entity.Note;

            db.Sections.Update(section);
            Commit();
        }