public async Task <DirectoryModel> GetById(Guid directoryId) { var directory = await _directoryRepository.GetById(directoryId); if (directory == null) { throw new NotFoundException("Directory not found."); } return(BusinessMapper.Map <DirectoryModel>(directory)); }