public List <BlockDto> GetBlockedList(int userID) { var user = userMockRepository1.GetUserById(userID); if (user == null) { throw new UserException("There is no user with that ID, try with anotherone!"); } var blockList = blockingRepository1.GetBlockedList(userID); if (blockList == null || blockList.Count == 0) { throw new UserException("User with that ID is not yet blocked by any other user, try with another user!"); } return(mapper1.Map <List <BlockDto> >(blockList)); }