Skip to content

Commit

Permalink
ignore first element (first element is next middleware)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yusuke Ito committed Jan 7, 2015
1 parent 77d1061 commit 0717c0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Fos/Middleware/OwinMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ void BuildHandler()
// filtered by matching all with Args type(except null Args)
ctor = MiddlewareType.GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public).Where(c => c.GetParameters().Length >= 1 && c.GetParameters().Length - 1 <= Args.Length).OrderByDescending(c => c.GetParameters().Length)
.Where((ct)=>{
return ct.GetParameters().Zip(Args,(pinfo,arg)=>(arg==null)||(pinfo.ParameterType == arg.GetType()))
return ct.GetParameters().Skip(1).Zip(Args,(pinfo,arg)=>(arg==null)||(pinfo.ParameterType == arg.GetType()))
.All(b=>b);
}).First();
}
Expand Down

0 comments on commit 0717c0d

Please sign in to comment.