Created
December 23, 2016 03:21
-
-
Save isdaviddong/c3a33d92fcbba8f18e3f24c2ffe1cbad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ExampleController : ApiController | |
{ | |
[Route("api/Example/{MethodName}")] | |
[HttpPost] | |
public IHttpActionResult ExecuteMethod(string MethodName) | |
{ | |
try | |
{ | |
//AssemblyLauncher | |
AssemblyLauncher assemblyLauncher = new AssemblyLauncher(); | |
//執行指定的Method | |
var ret = assemblyLauncher.ExecuteCommand<TestClassA>( | |
new TestClassA(), | |
MethodName, | |
Request.Content.ReadAsStringAsync().Result); | |
//回傳OK | |
return Ok(ret); | |
} | |
catch (Exception ex) | |
{ | |
//其他處理 | |
throw ex; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment