Below is the code:
string[] values = Acode.Split(\',\');
IEnumerable tst = null;
foreach (string a in values)
{
if (tst== null)
tst
That is because Concat will return a new instance of your enumerable.
Either use in your else :
tst = tst.Concat(...)
Or Change your Enumerable into list from the beginning :
string[] values = Acode.Split(',');
List tst= new List;
foreach (string a in values)
{
tst.AddRange(entities.Test.Where(g => (g.TCode == Convert.ToInt16(a))));
}
return tst;