In situations like that, I usually go with Concat
. That usually implies to me that a new object is being created.
var p = listA.Concat(listB);
var k = listA.Concat(item);
More Related Contents:
- Why shouldn’t I use “Hungarian Notation”?
- Allen Holub wrote “You should never use get/set functions”, is he correct? [duplicate]
- What is an ideal variable naming convention for loop variables? [closed]
- Is there a known implementation of an indexed linked list?
- What is the difference between concurrency and parallelism?
- Expression Versus Statement
- Why should hash functions use a prime number modulus?
- a mutable type inside an immutable container
- Singletons: good design or a crutch? [closed]
- What is Type-safe?
- Test loops at the top or bottom? (while vs. do while) [closed]
- Solving “Who owns the Zebra” programmatically?
- Try to describe polymorphism as easy as you can [closed]
- Pass by reference or pass by value? [closed]
- When to use unsigned values over signed ones?
- Making a system call that returns the stdout output as a string
- When is it okay to check if a file exists?
- What is eager loading?
- Why is writing a closed TCP socket worse than reading one?
- Are exceptions really for exceptional errors? [closed]
- How to calculate distance from a point to a line segment, on a sphere?
- Generate colors between red and green for a power meter?
- What’s the term for the part of the URL after the question mark?
- Hash Code and Checksum – what’s the difference?
- In what situations is octal base used?
- Is bit shifting O(1) or O(n)?
- How to design extensible software (plugin architecture)? [closed]
- Should I use `!IsGood` or `IsGood == false`?
- What is the use/advantage of function overloading?
- String Compare “Logic”