- 添加 MiniExcelLibs using(Stream.Query 扩展方法) - 修复 dynamic 类型 lambda 表达式编译错误(cast to object)
This commit is contained in:
parent
9e44533d29
commit
c36006894f
|
|
@ -1,4 +1,5 @@
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MiniExcelLibs;
|
||||||
using ZR.Model.Business.Dto;
|
using ZR.Model.Business.Dto;
|
||||||
using ZR.Service.Business.IBusinessService;
|
using ZR.Service.Business.IBusinessService;
|
||||||
|
|
||||||
|
|
@ -93,8 +94,9 @@ namespace ZR.Admin.WebApi.Controllers.Business
|
||||||
var exportList = new List<Dictionary<string, object>>();
|
var exportList = new List<Dictionary<string, object>>();
|
||||||
foreach (var item in list.Result)
|
foreach (var item in list.Result)
|
||||||
{
|
{
|
||||||
var props = item.GetType().GetProperties();
|
var obj = (object)item;
|
||||||
var dict = props.ToDictionary(p => p.Name, p => p.GetValue(item));
|
var props = obj.GetType().GetProperties();
|
||||||
|
var dict = props.ToDictionary(p => p.Name, p => p.GetValue(obj));
|
||||||
var row = new Dictionary<string, object>
|
var row = new Dictionary<string, object>
|
||||||
{
|
{
|
||||||
["编号"] = dict.GetValueOrDefault("Id"),
|
["编号"] = dict.GetValueOrDefault("Id"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user