Esempio n. 1
0
 public void EditTypes(Types types, string name)
 {
     if (types == null || types.Name == null || name == null)
     {
         throw new BadRequestException("Type require a name.");
     }
     if (!_repository.TypeExist(name))
     {
         throw new NotFoundException($"Type with name {name} not found.");
     }
     try
     {
         _repository.EditTypes(types, name);
     }
     catch (Exception ex)
     {
         throw new BusinessException(ex.Message);
     }
 }