1
- 您有一個自定義控制器動作,它修改了大量的數據(約5MB)。
- 您需要將此數據傳遞給您不允許修改的另一個控制器操作。
這樣做的最好方法是什麼?
正常的RedirectToAction會導致巨大的數據發佈。
TempData不能用作解決方法,因爲您無法修改其他控制器來讀取tempdata。
[HttpPost, ActionName("Import")]
public ActionResult ImportPost(int id)
{
var bigData = GetBigData(id);
bigData = ManipulateBigDataIntoFormatOtherControllerUnderstands(bigData);
// TODO: redirect to other controller (which has HttpPost attribute), somehow??
}
是臨時文件或數據庫事務選項? – 2013-02-08 15:51:37