删除每个迭代的struct列表的有效方法

这就是场景:

  1. 我有一个要在sql事务运行时创建的结构
public struct things{
   public string somestring{get; set;}
   public int someNumber{get; set;}
}

public List<things> populateList{
List<things> target = new List<things>();

//Some sql query to add item into lists

return target;
}
  1. 在某些情况下,结构本身可能在内存中有一些大块(想象像有上千个结构实例)。而且我有以下pdfsharp的实例:
public void doPrintDocument{
//Instance of pdfsharp
foreach(things item in populateList()){
//Iterate every item inside populateList
//Adding them into row

//Remove list item after adding into row?
}

3。想法是:如何在迭代后删除列表以动态调整内存,从而不会溢出。

yonghengwupan 回答:删除每个迭代的struct列表的有效方法

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3154062.html

大家都在问