Exemplo n.º 1
0
 /// <summary>
 /// Creates an instance of this exception.
 /// </summary>
 /// <param name="complexInstanceProvider">The complex instance provider, that was attempting to create an instance.</param>
 /// <param name="propertyName">The name of the property that could not be found.</param>
 internal NoMatchingPropertyException(ComplexInstanceProvider complexInstanceProvider, string propertyName) :
     base($"No property was found by the name: '{propertyName}' in Class Instance Provider '{complexInstanceProvider.DefinedType}'.")
 {
     ComplexInstanceProvider = complexInstanceProvider;
     PropertyName            = propertyName;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Creates an instance of this exception.
 /// </summary>
 /// <param name="complexInstanceProvider">The complex instance provider, that was attempting to create an instance.</param>
 /// <param name="constructorArgumentTypes">The types of instances, which should be used for creating the instance.</param>
 internal NoMatchingConstructorException(ComplexInstanceProvider complexInstanceProvider, IEnumerable <Type> constructorArgumentTypes)
     : base($"No matching constructor could be found for Class Instance Provider '{complexInstanceProvider.DefinedType}' taking following argument types:{Environment.NewLine}  {ToString(constructorArgumentTypes)}.{Environment.NewLine}The following constructors are available:{Environment.NewLine}{GetConstructorSignatures(complexInstanceProvider.DefinedType)}")
 {
     _complexInstanceProvider  = complexInstanceProvider;
     _constructorArgumentTypes = constructorArgumentTypes;
 }