I am building an XML file and when add this part of AllowanceCharge
it gives me this error Name of field or property being initialized in an object initializer must start with '.'.
and all the names start with period! what could be the issue here?
My code is:
.AllowanceCharge = New List(Of AllowanceChargeType) From
{
New AllowanceChargeType With
{
.ChargeIndicator = False,
.AllowanceChargeReason = New List(Of TextType) From
{
New TextType With
{
.Value = "discount"
}
},
.Amount = New AmountType With
{
.currencyID = "SAR",
.Value = 100
},
.TaxCategory = New TaxCategoryType With {
.ID = New IdentifierType With {
.Value = "S"
},
.Percent = 15.0,
.TaxScheme = New TaxSchemeType With {
.ID = "VAT"
},
}
}
},
The issue come when I added this part:
.TaxCategory = New TaxCategoryType With {
.ID = New IdentifierType With {
.Value = "S"
},
.Percent = 20,
.TaxScheme = New TaxSchemeType With {
.ID = "VAT"
},
}