So I create this list in two different locations. The first location creates it correctly its supposed to have 62 items in it like so.
But for some reason when I add it to the second PostSoftware action result I get the following with the exact same code.
The code is as follows
public ActionResult Software(TicketModel model)
{
ViewBag.Message = "Request software through the Tech Bar.";
var snow = new clsServNowAuth();
var tbl = clsServNowAuth.SoftwareTable();
var tbl2 = clsServNowAuth.SoftwareTableID();
tbl.Wait();
tbl2.Wait();
model.softwareList = tbl.Result;
model.softwareListID = tbl2.Result;
List<string> lstUserInfo = clsADInterface.GetInfo(model);
List<string> softwareList = model.softwareList;
if (String.IsNullOrEmpty(model.computerName) || String.IsNullOrEmpty(model.businessJustification))
{
// TODO
return View(model);
}
return RedirectToAction("PostSoftware", model);
}
public ActionResult PostSoftware(TicketModel model)
{
List<string> softwareList = model.softwareList;
//var test = model.selectedSoftwareList;
List<string> softwareListID = new List<string>();
foreach (var item in model.selectedSoftwareList)
{
int index = softwareList.FindIndex(a => a.Contains(item));
softwareListID.Add(model.softwareListID[index]);
}
// submit software request
clsServNowAuth.SoftwareRequest(model.computerName, model.businessJustification, softwareListID, model.lstUserInfo);
return View(model);
}
}