zoukankan      html  css  js  c++  java
  • 当实体类属性超多时候 映射给实体类属性赋值(拉姆达+实体类映射)

        {
                                     attributeSumValue=  beforEntity.Sum(e => Convert.ToDecimal( e.GetType().GetProperties().Where(o => o.Name == attributeName).Single().GetValue(e, null)));
                                     var attributeBefName = "C" + attributeName.Substring(1, attributeName.Length - 1);
                                     item.GetType().GetProperties().Where(b => b.Name == attributeBefName).Single().SetValue(item, attributeSumValue, null);
                                        //foreach (T_GL_IncomeStatementDataUpload Entity in   beforEntity)
                                        //{
                                        //    Entity.GetType().GetProperties().Where(o=>o.Name==attributeName).Single().GetValue(Entity,null);
                                        //}

                                    }

  • 相关阅读:
    微信商城中使用微信支付接口获取用户地址
    微信支付开发流程
    沉默多年,重新开博
    Extjs 表单验证后,几种错误信息展示方式
    自己对Extjs的Xtemplate的忽略
    js execCommand
    支付宝支付
    C# 将短时间格式变长正常时间格式
    SortedDictionary
    sql操作
  • 原文地址:https://www.cnblogs.com/520cc/p/3949582.html
Copyright © 2011-2022 走看看