title: How to pass objects into an attribute constructor
body: <p>I am attempting to pass objects into an Attributes constructor as follows:</p>
  
  <pre><code>[PropertyValidation(new NullOrEmptyValidatorScheme())]
  public string Name { get; private set; }
  </code></pre>
  
  <p>With this attribute constructor:</p>
  
  <pre><code> public PropertyValidationAttribute(IValidatorScheme validator) {
        this._ValidatorScheme = validator;
      }
  </code></pre>
  
  <p>The code won't compile. How can I pass an object into an attribute as above?</p>
  
  <p>EDIT: Yes NullOrEmptyValidatorScheme implements IValidatorScheme. </p>
  
  <p>The error: error CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type.</p>