I have in my code
List<BookedReelsState> retVal = new List<BookedReelsState>(somesize);
Match later in the code if some condition works I need to fill this entire List with same value.
Of course I can do it via foreach
loop and set values , Is there more elegant way to do so ?
I just to learn something new here .
retVal.AddRange(Enumerable.Repeat(value, somesize));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With