I have a custom list which inherits from Generic.List<T>
like this:
public class TransferFileList<T> : List<TransferFile> { .. }
When I set (where 'Files
' is a TransferFileList<T>
):
var files = uploadResponse.Files.Where(x => !x.Success).ToList()
the 'files
' object resolves as System.Collections.Generic.List<TransferFile>
, not TransferFileList<T>
, which is what I would expect as it was what was being filtered through the Where
, so how could I successfully return a list of TransferFileList<T>
into 'files'?
I did try:
var files = uploadResponse.Files.Where(x => !x.Success).ToList()
as TransferFileList<TransferFile>;
but using that safe cast, it just resolves as null.
Thanks guys and gals.