It also seems to struggle with type inference...
Sooooo slow...
if let newCustomer: NewCustomer = find(customerID: customerID) {
let parameters : [String : Any] = [
"Name": newCustomer.name,
"RegNo": newCustomer.regNo,
"VatNo": newCustomer.vatNo ?? "",
"Telephone": newCustomer.telephone,
"Email": newCustomer.email,
"Website": newCustomer.website ?? "",
"ContactName": newCustomer.contactName,
"ContactPosition": newCustomer.contactPosition,
"ContactTelephone": newCustomer.contactTelephone,
"InvoiceAddress1": newCustomer.invoiceAddress1,
"InvoiceAddress2": newCustomer.invoiceAddress2 ?? "",
"InvoiceAddress3": newCustomer.invoiceAddress3 ?? "",
"InvoiceTown": newCustomer.invoiceTown,
"InvoiceCounty": newCustomer.invoiceCounty ?? "",
"InvoicePostcode": newCustomer.invoicePostcode ?? "",
"InvoiceCountryCode": newCustomer.invoiceCountryCode,
"DeliveryAddress1": newCustomer.deliveryAddress1,
"DeliveryAddress2": newCustomer.deliveryAddress2 ?? "",
"DeliveryAddress3": newCustomer.deliveryAddress3 ?? "",
"DeliveryTown": newCustomer.deliveryTown,
"DeliveryCounty": newCustomer.deliveryCounty ?? "",
"DeliveryPostcode": newCustomer.deliveryPostcode ?? "",
"DeliveryCountryCode": newCustomer.deliveryCountryCode,
"SalesmanAreaCode": newCustomer.salesmanAreaCode,
"PriceCategoryID": newCustomer.priceCategoryID,
"DiscountPercentage": newCustomer.discountPercentage,
"PaymentTermsID": newCustomer.paymentTermsID
]
}
Instant...
if let newCustomer: NewCustomer = find(customerID: customerID) {
let parameters : [String : Any] = [
"Name": newCustomer.name as String,
"RegNo": newCustomer.regNo as String,
"VatNo": newCustomer.vatNo ?? "" as String,
"Telephone": newCustomer.telephone as String,
"Email": newCustomer.email as String,
"Website": newCustomer.website ?? "" as String,
"ContactName": newCustomer.contactName as String,
"ContactPosition": newCustomer.contactPosition as String,
"ContactTelephone": newCustomer.contactTelephone as String,
"InvoiceAddress1": newCustomer.invoiceAddress1 as String,
"InvoiceAddress2": newCustomer.invoiceAddress2 ?? "" as String,
"InvoiceAddress3": newCustomer.invoiceAddress3 ?? "" as String,
"InvoiceTown": newCustomer.invoiceTown as String,
"InvoiceCounty": newCustomer.invoiceCounty ?? "" as String,
"InvoicePostcode": newCustomer.invoicePostcode ?? "" as String,
"InvoiceCountryCode": newCustomer.invoiceCountryCode as String,
"DeliveryAddress1": newCustomer.deliveryAddress1 as String,
"DeliveryAddress2": newCustomer.deliveryAddress2 ?? "" as String,
"DeliveryAddress3": newCustomer.deliveryAddress3 ?? "" as String,
"DeliveryTown": newCustomer.deliveryTown as String,
"DeliveryCounty": newCustomer.deliveryCounty ?? "" as String,
"DeliveryPostcode": newCustomer.deliveryPostcode ?? "" as String,
"DeliveryCountryCode": newCustomer.deliveryCountryCode as String,
"SalesmanAreaCode": newCustomer.salesmanAreaCode as String,
"PriceCategoryID": newCustomer.priceCategoryID as Int,
"DiscountPercentage": newCustomer.discountPercentage as Double,
"PaymentTermsID": newCustomer.paymentTermsID as Int
]
}