I have function like this:
private T DeserializeStream<T>(Stream data) where T : IExtensible
{
try
{
var returnObject = Serializer.Deserialize<T>(data);
return returnObject;
}
catch (Exception ex)
{
this.LoggerService.Log(this.AccountId, ex);
}
return null;
}
Everything is good, except that it complains about return null;
part
Cannot convert expression type 'null' to type 'T'
How do I return null from function like this?