In old legacy project we have a lot of code like this:
var result = someService.AddRecord(data);
TempData["Success"] = result.Success;
TempData["Message"] = result.Message;
return RedirectToAction("Rakamakafo");
But then we faced the situation when requests processed serial in controller, which caused by locking nature of Session
object and solved this by turning Session
to read-only:
[SessionState(System.Web.SessionState.SessionStateBehavior.ReadOnly)]
It's all good except TempData
object (which relies on session) stopped working.
How this can be solved in clean way without rewriting whole application to AJAX?