Orchard - 在新线程中调用外部服务

时间:2015-10-14 10:10:19

标签: asynchronous orchardcms

我需要为进程外部服务调用创建新线程。在我的模块控制器中。

我需要将创建的内容项的id插入到线程方法并使用Orchard Services。

我的情况: ¨

public async Task<ActionResult> CreateApplication(Apply postApply)
{
  if (ModelState.IsValid)
  {
     var myItem = this._services.ContentManager.New("Zadosti");
     dynamic dynContentItem = myItem;
     dynContentItem.Zadosti.Jmeno.Value = postApply.Name;
     dynContentItem.Zadosti.Prijmeni.Value = postApply.SureName;
     this._services.ContentManager.Publish(myItem);

     // I need to get ID of created content item and call method in new thread
     CallMethodInNewThread(idOdContentItem);


  }
}

CallMethodInNewThread(int id){
   // External service async  CALL -> wait for response
   // Get content item with "id" from DB
   // Update and save content item
}

感谢您的帮助!

0 个答案:

没有答案