I have a list that I created from a SQL query and another list using linq:
var List1 = db.Database.SqlQuery<Apples>("spAllApples AppleNum", param).ToList();
var List2 = (from r in db.bananas where r.bananaNum == id).ToList();
The problem I have ran into is that one shows up as a list and the other as an IEnumerable when I try to combine them using .Concat()
as well as AddRange
as mentioned here.
I have also tried doing this:
IEnumerable<Apples> List3 = List1.ToList();
List3.Concat(List2);
and was met with the error
IEnumerable<Apple> does not contain a definition for 'Concat' or 'AddRange'
Due to permissions, I do not have access to write stored procs for List2
which would have been the other simple fix. How do I go about combining these two lists?