A Model contains, amongst other properties, a method which returns an MSChart as a MemoryStream.
In my View I copy the MemoryStream to TempData[\"Chart\"] and then u
The acedemic way would be to retrieve the model object again in the RenderChart
action and return the chart image to the view.
But i think its a valid approach to store the image in TempData
for reducing database roundtrips and boosting performance.
Maybe its even unnecessary to improve the performance. The database will have the data available in its cache when reading it the second time and the additional 10ms needed to fetch the data again might not be noticeable by the user.
At least TempData
seems to be the right store because the value is deleted from the collection when its read by the RenderChart
action.