zoukankan      html  css  js  c++  java
  • AnonymousType匿名类型和对象之间的转换

    本文转载:http://www.cnblogs.com/dean-Wei/p/3150553.html

    一、匿名对象转换为对象。

    1、问题:

    2、解决方案:强制指定类型。

    解决之。

     

     

     

    二、 对象转换为匿名对象。

                   XElement t = xmlResponResult;
                    //执行API信用卡退款后返回结果。
                    var refundResponse = new
                                 {
                                     result = t.Element("result").Value,
                                     responsecode = t.Element("responsecode").Value,
                                     transactionID = t.Element("tranid").Value,//TransactionID
                                     authcode = t.Element("authcode").Value,
                                     item_number = t.Element("trackid").Value,//item_number
                                     merchantid = t.Element("merchantid").Value,
                                     refund_id = t.Element("udf1").Value,
                                     account_id = t.Element("udf2").Value,
                                     bill_amount = t.Element("udf3").Value,
                                     bill_currencycode = t.Element("udf4").Value
                                 };

  • 相关阅读:
    golang recover
    golang sort
    golang matrix
    golang encoding/json
    go package的理解
    golang beego cache
    git操作
    阿里云图标使用
    Stylus的使用
    vue-preview的使用
  • 原文地址:https://www.cnblogs.com/51net/p/3413775.html
Copyright © 2011-2022 走看看