首页 > 代码库 > 当实体类属性超多时候 映射给实体类属性赋值(拉姆达+实体类映射)

当实体类属性超多时候 映射给实体类属性赋值(拉姆达+实体类映射)

    {
                                 attributeSumValue=http://www.mamicode.com/ 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);
                                    //}

                                }

当实体类属性超多时候 映射给实体类属性赋值(拉姆达+实体类映射)