I have the following code snippet
string[] lines = objects.Split(new string[] { "\r\n", "\n" }, StringSplitOptions.None);
//convert the array into a list for easier comparison
List<string> StringtoList = lines.OfType<string>().ToList();
//get the database list here
List<string> sensitiveApps = testConnection.SelectSensitive();
//compare the 2 lists to get the difference
List<string> except = sensitiveApps.Except(StringtoList,StringComparer.OrdinalIgnoreCase);
However, I keep getting the above error, could anyone point me in the right direction?
I’m guessing the last line is throwing an exception. Try changing:
to:
This exception is occurring as
Exceptwill be returning anIEnumerable<string>.