I have a list of strings which is populated by a query from database (entity frameworks):
var accountIds = new List<string>();
Now I want to add two list of strings to my collection, for example, I have these two queries:
using (var myketDB = new MyketReadOnlyDb())
{
if (!string.IsNullOrWhiteSpace(name))
{
accountIds = myketDB.AppDevelopers
.Where(n => n.RealName.Contains(name))
.Select(e => e.Email).ToList();
}
if (!string.IsNullOrWhiteSpace(email))
{
accountIds = myketDB.Accounts
.Where(e => e.Mail.Contains(email))
.Select(e => e.Email).ToList();
}
}
So with this query accountIds
changes which I don't want this to happen. I want to have both lists in accountIds. something like this :
accountIds.add(//first query);
accountIds.add(//2nd query);
something like a union (I don't want to use union). I'm new to the collection list. many thanks.