1
Vote

PageRepository.GetDescendentsAccessibleToCurrentUser<T>() fails on .Cast<T>()

description

If any of the descendants is not castable to T an "Unable to cast object of type '?' to type '?'." error will be thrown. Possible solution might be to use OfType<T>(), like GetChildrenAccessibleToCurrentUser<T>().

comments