I have three seperate ToSelectList items and i wanted to combine each list into one dropdown list box and was wondering if i could use a Union for it. Or is it that a union is only for 2 toselectlist items only.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
When item exists in more than one list, do you want item to appear once, or as many times as they exists in all lists?
As I understand you want just concat:
If you want to avoid duplicates:
Union is more expensive, as it has to go through the list and take care of duplicates.
If your item is a reference type and there is no IComparable or IEquable interfaces and you don’t provide IEqualityComparer, you likely don’t need Union.