Basically I am trying to do something like this:
image.Layers
which returns an IEnumerable for all layers except the Parent
layer,
There is no single method which does this. The closest is the Enumerable.Concat
method but that tries to combine an IEnumerable
with another IEnumerable
. You can use the following to make it work with a single element
image.Layers.Concat(new [] { image.ParentLayer });
Or just add a new extension method
public static IEnumerable ConcatSingle(this IEnumerable enumerable, T value) {
return enumerable.Concat(new [] { value });
}