Example #1
0
        /// <summary>
        /// Return a XML representation of this object.
        /// </summary>
        /// <param name="CustomMobileAuthorizeStartRequestSerializer">A delegate to serialize custom MobileAuthorizeStart XML elements.</param>
        public XElement ToXML(CustomXMLSerializerDelegate <MobileAuthorizeStartRequest> CustomMobileAuthorizeStartRequestSerializer = null)
        {
            var XML = new XElement(OICPNS.MobileAuthorization + "eRoamingMobileAuthorizeStart",

                                   new XElement(OICPNS.MobileAuthorization + "EvseID", EVSEId.ToString()),

                                   QRCodeIdentification.ToXML(OICPNS.MobileAuthorization + "QRCodeIdentification"),

                                   PartnerProductId.HasValue
                                          ? new XElement(OICPNS.MobileAuthorization + "PartnerProductID", PartnerProductId.ToString())
                                          : null,

                                   (GetNewSession.HasValue)
                                          ? new XElement(OICPNS.MobileAuthorization + "GetNewSession", GetNewSession.Value ? "true" : "false")
                                          : null

                                   );

            return(CustomMobileAuthorizeStartRequestSerializer != null
                       ? CustomMobileAuthorizeStartRequestSerializer(this, XML)
                       : XML);
        }