Deserialize Stream to List<T> or any other type
- by Sam
Attempting to deserialize a stream to List<T> (or any other type) and am failing with the error:
The type arguments for method 'Foo.Deserialize<T>(System.IO.Stream)' cannot be inferred from the usage. Try specifying the type arguments explicitly.
This fails:
public static T Deserialize<T>(this Stream stream)
{
…