示例#1
0
 private void ValidateSection(Section section)
 {
     if (ModelState.IsValidField("Section.Name"))
     {
         if (_sectionsRepository.SectionAlreadyExists(section.Id, section.Name))
         {
             ModelState.AddModelError("Section.Name",
                                      "The section has already been added.");
         }
     }
 }