我使用MVC3及ASP.NET 4.5异步与MVC3和ASP.NET4.5
据我了解,尽管我使用ASP.NET 4.5,我不能使用新的MS“等待”, “任务”异步功能。我对么?我是否仍然需要使用旧的“AsyncController”方法。
最后,我试图做的是“异步”一个私有方法,而不是完整的Action,就像“SendMail”方法调用会发生什么。
即。
public ActionResult Index()
{
SendMail(); // Inbuilt Async
//Copy Document in DB. This is coded by private method in class, but needs to be fired asynchronously
CopyDocument();
ViewBag.Message = "Getting documents, Check back soon";
return View();
}
那么我怎么能异步只是“CopyDocument()”。
非常感谢提前。
谢谢你。这对我来说是非常新的。 – SamJolly 2014-11-14 23:22:37
所有新东西都很有趣!和我们所有的学习者:) – 2014-11-15 00:20:37