Skip to content

Commit 2d09654

Browse files
committed
fix for #3 to always add the script controllers
1 parent ae3541b commit 2d09654

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/ScriptCs.WebApi/WebApi.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ public HttpSelfHostServer CreateServer(HttpSelfHostConfiguration config, ICollec
2929

3030
public HttpSelfHostServer CreateServer(HttpSelfHostConfiguration config, params Assembly[] assemblies)
3131
{
32-
var types = assemblies.Length == 0 ?
33-
Assembly.GetCallingAssembly().GetTypes() :
34-
assemblies.SelectMany(a => a.GetTypes()).ToArray();
35-
32+
var controllerAssemblies = new List<Assembly> {Assembly.GetCallingAssembly()}.Union(assemblies);
33+
var types = controllerAssemblies.SelectMany(a => a.GetTypes()).ToArray();
3634
var controllerTypes = ControllerResolver.WhereControllerType(types).ToList();
3735
return CreateServer(config, controllerTypes);
3836
}

0 commit comments

Comments
 (0)