c# - adding files to a list in a method -


i have method wrote add files list, inside method list contains files, when step out of method debugger, list empty.

list<string> lstpdfapps = new list<string>();  public void generateemployeeapplication(int enrollmentid, long packageid, int carrierid) {     --snip--     get.fill(dt, carrierid, 14);     foreach (datarow dr in dt)     {         var param = new list<sqlparameter>();         param.add(new sqlparameter("@enrollmentid", enrollmentid));          param.add(new sqlparameter("@packageid", packageid));         var files = dr.pdfstamp(param);         lstpdfapps.addrange(files.where(file => file != ""));      } } 

the list public list of strings

any ideas?

i'm idiot.

i declaring list inside method calls generateemployeeapplication() - i'm guessing once step out of list kaput.

i moved declaration outside methods , retains information.

sorry wasting everyone's time!


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -