ServiceStack/ServiceStack — pull request #440 by paksys (2013-02-04 01:48:58+00:00)
Title: Update src/ServiceStack/Funq/AutoWireHelpers.cs

If I have BaseController class inherited from ServiceStackController and this BaseController class has constructors, Funq registration in AppHost fails during runtime. Getting below exception. Suggesting a change from ".First" to ".FirstOrDefault":

[InvalidOperationException: Sequence contains no matching element]
System.Linq.Enumerable.First(IEnumerable`1 source, Func`2 predicate) +2538402
Funq.AutoWireHelpers.GetConstructorWithMostParams(Type type) +201
Funq.AutoWireHelpers.ConstrcutorExpression(MethodInfo resolveMethodInfo, Type type, Expression lambdaParam) +49
Funq.AutoWireHelpers.GenerateAutoWireFn() +359
Funq.Container.RegisterAutoWired() +43