I'am trying to using Tempdata[] to store some objects on redirect and it's not working.
I tried in controller that returns RedirectToAction("Index"):
TempData["something"] = objectarray;
where objectarray is an array of objects.
and then obj[] foundmoviesfromredirect = (obj[])TempData["something"];
in an controller that returns View(list);
There is some problem with serializing that object as I get the error:
An unhandled exception has occurred: The 'Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.TempDataSerializer' cannot serialize an object of type <the type>
What I'am looking to do is to store objects in the object array, and pass that array to another controller adding the contents to a list in that controller and return the view. I'am having some really hard time to pass this object array to the another controller.
In short, is it impossible to use tempdata to store an object between requests? If not, how is it possible?