/// <summary>
        /// Method to convert the objevt into XML string.
        /// </summary>
        /// <param name="obj">Object to parse.</param>
        /// <returns>Converted string.</returns>
        private string ToXML(VMNetworkMappingInfo obj)
        {
            var stringwriter = new System.IO.StringWriter();
            var serializer   = new XmlSerializer(typeof(VMNetworkMappingInfo));

            serializer.Serialize(stringwriter, obj);
            return(stringwriter.ToString());
        }
        /// <summary>
        /// This method is responsible to add specified vlan entry into the local variable.
        /// </summary>
        protected override void DoODLVSEMCmdlet()
        {
            var JavaScriptSerializer = new JavaScriptSerializer();

            JavaScriptSerializer.MaxJsonLength = int.MaxValue;
            StringBuilder json = new StringBuilder("\"VtnHostName\":" + JavaScriptSerializer.Serialize(this.VtnHostName));

            ODLVSEMETW.EventWriteDoCmdlet(this.CmdletName,
                                          "Retrieving VM network maping info.",
                                          json.ToString());
            TransactionManager txnMng = new TransactionManager();

            txnMng.StartTransaction();
            var operation = TransactionManager.Operation.None;
            VMNetworkMappingInfo vMNetworkMappingInfo = null;

            try {
                vMNetworkMappingInfo = VSEMConfiguration.GetVSEMVMNetworkMappingInfo(txnMng, this.VtnHostName);
                ODLVSEMETW.EventWriteReturnLibrary("VM network mapping information is retrieved.", string.Empty);
                if (vMNetworkMappingInfo == null)
                {
                    ODLVSEMETW.EventWriteProcessCmdletWarning(this.CmdletName,
                                                              "VM network mapping information not found.");
                    this.WriteWarning("VM network mapping information not found.");
                }
                else
                {
                    this.WriteObject(this.ToXML(vMNetworkMappingInfo), true);
                }
            } catch (Exception ex) {
                Exception exception = VSEMODLExceptionUtil.ConvertExceptionToVSEMException(ex);
                ODLVSEMETW.EventWriteFailedCmdlet(this.CmdletName, exception.GetType() + " : " + ex.Message);
                operation = TransactionManager.Operation.Rollback;
                throw exception;
            } finally {
                txnMng.EndTransaction(operation);
                string output = "\"vMNetworkMappingInfo\":" + JavaScriptSerializer.Serialize(vMNetworkMappingInfo);
                ODLVSEMETW.EventWriteEndCmdlet(this.CmdletName, output);
            }
        }