using System.Collections.Generic;
public static void Main()
List<string> colorList = new List<string> { "red", "red", "yellow", "blue", "blue", "orange", "green", "red" };
var hasDuplicate = HasDuplicateName(colorList, "red");
Console.WriteLine(hasDuplicate);
private static bool HasDuplicateName(IEnumerable<string> items, string name)
if (items.Any() && !string.IsNullOrEmpty(name))
return items.Where(a => a == name.Trim().ToLowerInvariant()).Count() > 1 ? true: false;