I have two List<int> instances. Now I want to combine them into a third list.
public List<int> oldItemarry1 // storing old item
{
get
{
return (List<int>)ViewState["oldItemarry1 "];
}
set
{
ViewState["oldItemarry1 "] = value;
}
}
public List<int> newItemarry1 // storing new item
{
get
{
return (List<int>)ViewState["newItemarry1 "];
}
set
{
ViewState["newItemarry1 "] = value;
}
}
public List<int> Itemarry1 // want to combine both the item
{
get
{
return (List<int>)ViewState["Itemarry1 "];
}
set
{
ViewState["Itemarry1 "] = value;
}
}
Please some one tell me how to do that?
Use the Union method; it will exclude duplicates.