/// <summary> /// Gets the multiple CLR resources for the given CLR resource type. /// </summary> /// <typeparam name="TResource">Type of CLR resource to get.</typeparam> /// <returns>Returns the LINQ-to-objects collection of CLR resources if they exist, /// empty collection otherwise.</returns> public static IEnumerable <TResource> GetResourceCollection <TResource>(this IDocumentReader documentReader) where TResource : class, IResource { Contract.Requires(documentReader != null); var clrResourceType = typeof(TResource); var clrResourceCollection = documentReader.GetResourceCollection(clrResourceType).Cast <TResource>(); return(clrResourceCollection); }