Assmbly.GetTpes()获取程序集中的类型,但如果我还想要嵌套类(OrderLine),我该怎么做?我只知道程序集的名称,而不是类名,因此GetType(Order + OrderLine)不起作用.
public class Order
{
public class OrderLine
{
}
}
Run Code Online (Sandbox Code Playgroud) 在内存测试中测试ASP.NET Web API控制器时,我收到"内部服务器错误"(状态码500).
[TestFixture]
public class ValuesControllerTest
{
private HttpResponseMessage response;
[TestFixtureSetUp]
public void Given()
{
var config = new HttpConfiguration
{
IncludeErrorDetailPolicy = IncludeErrorDetailPolicy.Always
};
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { controller = typeof(ValuesController).Name.Replace("Controller", string.Empty), id = RouteParameter.Optional }
);
//This method will cause internal server error but NOT throw any exceptions
//Remove this call and the test will be green
ScanAssemblies();
var server = new HttpServer(config);
var client = new HttpClient(server);
response = client.GetAsync("http://something/api/values/5").Result;
//Here …Run Code Online (Sandbox Code Playgroud) 使用EventStore时如何与NServiceBus集成?
我是NSB和ES的新手,并试图在使用ES和CQRS时找出NSB的最佳设置.
我和示例中的DispatchCommit一样挂钩NSB, https://github.com/joliver/EventStore/blob/master/doc/EventStore.Example/MainProgram.cs
一些代码或指导非常感谢.