public async Task <ApiResult> OutPutDemo1([FromServices] IDemoMainService _demoMainServices) { var data = await _demoMainServices.GetListAsync(p => p.MainId > 0); //需要将List置为null data.ForEach(item => { item.Attachs = null; item.ImageList = null; item.Items = null; }); var excel = await _exporter.Export("output.xlsx", data); return(ApiResult.OK(excel.FileName)); }
public DemoMainController(ILogger <DemoMainController> logger, IDemoMainService demoMainService) { _logger = logger; _demoMainService = demoMainService; }