public App() { ServiceCollection services = new ServiceCollection(); var config = AppConfiguration.GetServiceConfiguration(); services.AddWPF(config); services.AddApiConsumer(config); ServiceProvider = services.BuildServiceProvider(); _appMessageHandler = ServiceProvider.GetRequiredService <AppMessageHandler>(); }
public ActionResult Post(PostModel postModel) { if (!CheckSignature.Check(postModel.Signature, postModel.Timestamp, postModel.Nonce, Token)) { //return Content("参数错误!");//v0.7- return(new WeixinResult("参数错误!"));//v0.8+ } postModel.Token = Token; postModel.EncodingAESKey = EncodingAESKey; //根据自己后台的设置保持一致 postModel.AppId = AppId; //根据自己后台的设置保持一致 var messageHandler = new AppMessageHandler(Request.GetRequestMemoryStream(), postModel, 10); messageHandler.Execute();//执行微信处理过程 //return Content(messageHandler.ResponseDocument.ToString());//v0.7- //return new WeixinResult(messageHandler);//v0.8+ return(new FixWeixinBugWeixinResult(messageHandler));//v0.8+ }