Um.
If as you say:
both payementPortfolioIds and portfolioID are array's
then the Contains is wrong, because you are asking it to iterate through an array of ints, trying to compare each member of the collection - i.e. each int value - against an array of ints.
Effectively, what you are asking is:
int[] portfolioID;
foreach (int i in l.paymentPortfolioIds)
{
if (i == portfolioID)
{
...
}
Which is clearly going to cause a "I can't convert an array to a int" error.
Not sure exactly what you are trying to do here, but that is not going to work!