internal clientinvoicerow ToNative()
 {
     return(new clientinvoicerow
     {
         quantity = Quantity,
         price = Price,
         product = new productreference {
             id = ProductId
         },
         unit = Unit ?? string.Empty,
         description = Description ?? string.Empty,
         dimensions = DimensionEntries?.Select(x => x.ToNative()).ToArray(),
         period = AccrualsPeriod?.ToNative(),
         deliverydate = DeliveryDate.GetValueOrDefault(),
         deliverydateSpecified = DeliveryDate.HasValue,
         discount = Discount?.ToNative(),
         fields = Fields?.Select(x => x.ToNative()).ToArray(),
         accruals = Accruals?.Select(x => x.ToNative()).ToArray()
     });
 }