views:

27

answers:

0

I would like to know if there's any way to specify an inline array (lets say of strings) to custom attribute on a property in vb.net.

I have the following example that doesn't compile in vb.net (.net 1.1):

Attributes.ManyToOne(New String() {"a", "b", "c"})> _
Public Property PaymentTerms() As PaymentTerms

The attribute is defined in another assembly as:

[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
 public class ManyToOne : System.Attribute
 {
  private string[] _columns;


  public ManyToOne(string[] columns)
  {
   _columns = columns;
  }

  public string[] Columns
  {
   get { return _columns; }
   set { _columns = value; }
  }
 }

I get compiler error when I feed the array to the custom attribute in vb.net. I have no problem in C#, just vb.net. What is the correct syntax in this silly language?

Important: Using .net 1.1.