コード例 #1
0
ファイル: DeleteGroupCommand.cs プロジェクト: ashic/Hermes
 public void Execute(Identity id)
 {
     if (!entityById.Exist <Group>(id))
     {
         throw new EntityNotFoundException(typeof(Group), id);
     }
     if (childGroupsOfGroup.HasChilds(id))
     {
         throw new ValidationException(string.Format(Texts.GroupContainsChildGroups, id));
     }
     if (topicsByGroup.HasTopics(id))
     {
         throw new ValidationException(string.Format(Texts.GroupContainsChildTopics, id));
     }
     repository.MakeTransient(id);
 }