.NET Fiddle

CSharp · Console

/Program.cs

using System;
using System.Linq;
using System.Collections.Generic;
					
public class Program
{
	public static void Main()
	{
		var projectIdsToExclude = new List<int>{1,3,5};
		var allProjectIds = new List<int>{1,2,3,4,5,6,7};
		var filteredList = allProjectIds.Where(a => !projectIdsToExclude.Contains(a));
		foreach(var item in filteredList)
			Console.Write(item);
	}
}
;