using System.Collections.Generic;
private static List<(MyEnum type, string somePath)> myList1 = new List<(MyEnum type, string somePath)>
(MyEnum.Some, "/Images"),
(MyEnum.Values, "/Images/Path"),
private static List<(MyEnum type, string somePath)> myList2 = new List<(MyEnum type, string somePath)>
(MyEnum.Values, "/Images/Path"),
(MyEnum.Some, "/Images"),
public static void Main()
var myPath = "some/path/to/Images/Path";
var result1 = myList1.FirstOrDefault(m => myPath.Contains(m.somePath));
var result2 = myList2.FirstOrDefault(m => myPath.Contains(m.somePath));
Console.WriteLine("Expecting enum of type MyEnum.Values: " + result1.type);
Console.WriteLine("Expecting enum of type MyEnum.Values: " + result2.type);