I have generated a class from XSD. The following
[System.Xml.Serialization.XmlElementAttribute("mailer", Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
public itemOrderMailer[] mailer {
get {
return this.mailerField;
}
set {
this.mailerField = value;
}
}
Does not allow me to use syntax
itemOrder order = new itemOrder();
order.mailer = {};
I get error “; expected” from the compiler.
There’s no issue doing
int[] ints = { };
Why? Aren’t these both arrays?
It is working with the ints only, because you have declaration and initialization in the same line.
Try this:
it isn’t working.
This however is:
But it really doesn’t make a lot of sense, because you just created an array with 0 elements in it. Not very useful…
Anyway, to make your code work with the mailer, use this: