private void ValidateParameter(IBuildContext ctx)
 {
     if (ctx.Parameters.Length <= _parameterId)
     {
         throw new InvalidOperationException(string.Format("Parameter index {0} is outside of bounds. Expected parameters: [{1}]", _parameterId, StringFormat.Join(ctx.Parameters, ",")));
     }
     if (!Validators.IsInHierarchy(ctx.Parameters[_parameterId], ExpressionType))
     {
         throw new InvalidOperationException(string.Format("Parameter index {0} is of {1} type, while type {2} is expected", _parameterId, ExpressionType, ctx.Parameters[_parameterId]));
     }
 }
Example #2
0
 private static string FormatMissingConstructorException(Type type, Type[] types)
 {
     return(string.Format("No matching constructor found for type {0} with parameters: [{1}]", type, StringFormat.Join(types, ", ")));
 }