private static Inspected <TParameter> CreateInspected <TParameter>(Expression <Func <TParameter> >[] arguments, InspectionType inspectionType) { //Yes the loop is not as pretty as a linq expression but this is performance critical code that might run in tight loops. If it was not I would be using linq. var inspected = new InspectedValue <TParameter> [arguments.Length]; for (var i = 0; i < arguments.Length; i++) { inspected[i] = new InspectedValue <TParameter>( value: ContractsExpression.ExtractValue(arguments[i]), type: inspectionType, name: ContractsExpression.ExtractName(arguments[i])); } return(new Inspected <TParameter>(inspected)); }
///<summary>Standard constructor.</summary> public EnumerableIsEmptyContractViolationException(InspectedValue badValue) : base(badValue) { }
///<summary>Standard constructor that will construct a message based on the name and value of the failing member. </summary> public ContractViolationException(InspectedValue badValue) { BadValue = badValue; }