Skip to content

Commit c6303a4

Browse files
committed
Merge pull request #10 from glennblock/dev
Cleanup and adding logic to remote IHttpController from returned types
2 parents 6e80279 + a2fcd6b commit c6303a4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/ScriptCs.WebApi/ControllerResolver.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Collections.Generic;
33
using System.Diagnostics.Contracts;
44
using System.Linq;
5+
using System.Web.Http.Controllers;
56
using System.Web.Http.Dispatcher;
67

78
namespace ScriptCs.WebApi
@@ -28,14 +29,14 @@ internal static IEnumerable<Type> WhereControllerType(IEnumerable<Type> types)
2829
{
2930
Contract.Requires(types != null);
3031

31-
return types.Where(x => typeof(System.Web.Http.Controllers.IHttpController).IsAssignableFrom(x));
32+
return types.Where(x => typeof(IHttpController).IsAssignableFrom(x) && x != typeof(IHttpController));
3233
}
3334

3435
internal static bool AllAssignableToIHttpController(IEnumerable<Type> types)
3536
{
3637
Contract.Requires(types != null);
3738

38-
return types.All(x => typeof(System.Web.Http.Controllers.IHttpController).IsAssignableFrom(x));
39+
return types.All(x => typeof(IHttpController).IsAssignableFrom(x));
3940
}
4041
}
4142
}

0 commit comments

Comments
 (0)