Good morning,
I created a structure that will be a shortened version of the class that I already have. I am trying to use a linq query to iterate over a MyClass list and create a list based on the results (a list of several lists based on several MyClass properties). Something like that...
List<MyStructure> thisList = (from MyClass thisClass in List<MyClass> select thisClass.Property1, thisClass.Property2, thisClass.Property3 Distinct.Cast<MyStructure>()).ToList<MyStructure>();
where MyStructure contains 3 variables Property1, Property3 and Property3 with the same types.
I fully understand that the above code will not compile, but this is the type I'm trying to do. Can someone please tell me is it possible to do this?
thanks
source share