class Program { class TestClass { public int MyProperty { get; set; } public int MyProperty1 { get; set; } } static void Main(string[] args) { Collection<testclass> testCollection = new Collection<testclass>(); testCollection.Add(new TestClass()); testCollection.Add(new TestClass()); var test = (from str in testCollection select new {p1 = str.MyProperty, p2 = str.MyProperty1}); foreach (var item in test) { testCollection.Remove(testCollection.Where(x => x.MyProperty1 == item.p2).First()); } } }</testclass></testclass>
var test = (from str in testCollection select new {p1 = str.MyProperty, p2 = str.MyProperty1}).ToList();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)