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
                                 };

  • 相关阅读:
    flask的过滤器
    flask的for、if语法
    flask模版语法
    flask response跳转页面
    flask 简单注册页面
    Egress 网关 TLS 连接 发起的过程 (SDS)
    Egress Gateway
    Egress TLS Origination
    Istio ServiceEntry 访问外部服务
    font awesome icon
  • 原文地址:https://www.cnblogs.com/51net/p/3413775.html
Copyright © 2011-2022 走看看