I want to assign List<Object>
I get a new from this methodList<MyClass>
public List<Object> Deserialize(string path)
{
IFormatter seri = new BinaryFormatter();
Stream str = new FileStream(path, FileMode.Open, FileAccess.Read);
List<Object> Lista = (List<Object>)(seri.Deserialize(str));
str.Close();
return Lista;
}
My intention is to call this method with different classes and then revert it back to the previous type, but I am getting an error trying to revert it back.
source
to share