I have two List<T>s which are both the same type. Is there an easy way to merge to the two sets without looping though both sets and merging them into a third?
Code
var myObject= new List<Core.MyObject>();
var myObject2= new List<Core.MyObject>();
if(!string.IsNullOrEmpty(txb.Text))
{
var repository = ServiceLocator.Current.GetInstance<Core.RepositoryInterfaces.IRepository>();
myObject= repository.GetWherePostCodeLike(txb.Text).ToList();
}
if(!string.IsNullOrWhiteSpace(ddl.SelectedValue))
{
var repository = ServiceLocator.Current.GetInstance<Core.RepositoryInterfaces.IRepository>();
myObject2= repository.GetNearTownX(ddlLocations.SelectedValue).ToList();
}
It would have been nice to able able to just use the += on the second, but this is not allowed... Any ideas?
DataSets.