AsReadOnly() is a convenient method to get a read-only image (not expensive compared to immutable collections' copies) of a collection. I am wondering if ImmutableList has AsReadOnly like method? If no, any easy way to implement similarly?
ImmutableList<T>
is copied by reference so is perfectly safe to pass around without a performance penalty. Thus there is no need for an AsReadOnly
method as it wouldn't make it any easier to copy.