I am using LINQ like
from a in b.Descendants("SomeNode")
select new MyClass
{
isfirst= false,
islast = false,
};
How can I get the position of the element here? I basically want to know which one is first and which one is last element.
Something like …
… should work.
Per comment: Changed anonymous class to concrete class. This assumes that IsFirst and IsLast are boolean properties with a setter on a class called MyClass.