score:3
"The dictionary passed in, is constantly increasing in size"
Do you mean that it's being modified while you're executing this code? That's a no-no. I suspect the ToList
call is failing due to this. (After ToList()
has executed, the list should be effectively separate from the dictionary.)
Basically Dictionary<TKey, TValue>
doesn't support concurrent reading and writing. You might want to look at ConcurrentDictionary<,>
which allows you to iterate over it while another thread is writing.
One suggestion to improve performance when it's all working: call side.ToString()
once at the start of the method, instead of on every single loop iteration.
Source: stackoverflow.com
Related Articles
- .NET LINQ: Check array index and length EXCEPTION
- "unrecognized expression node array index linq" exception in LINQ to SQL
- Linq code to get the index of an object in an array from an object within a list
- How to get a byte array length using LINQ to Entities?
- Using C# Linq to return first index of null/empty occurrence in an array
- Linq - Get the Index of the Last Non-Zero Number of Array
- LINQ Source Code Available
- Get array index values of the top 1000 largest entries inside an array using LINQ
- Intermittent Linq FirstOrDefault Error - Index was outside the bounds of the array
- How to use Linq to sort an array by Length and then value
- Check if a value from one array exists in another array using linq
- c# - LINQ find 2D jagged array minimum, return index
- creating Linq to sqlite dbml from DbLinq source code
- Get Index of a String Array after Split using LINQ
- Get array values from specific index with specified length
- c# - index of array entries inside another array using LINQ
- Linq Check if array of string has a partial match in other array
- How to get the index of int array when using linq query
- How can I check the number of calls to the database in LINQ query when using .NET Core and Code First?
- init float array incrementing index value every x times with Linq
- Sum elements of the array based on index position, preferable with Linq
- Null reference exception in my LINQ to XML code
- Add index position Value of an array of array using Linq
- Anonymous types LinQ - Check for null value - Exception
- LINQ orderby int array index value
- Index was outside the bounds of the array in lambda expressions linq
- source code for LINQ 101 samples
- How to check the second element of an array in linq only if it exists
- Converting from Linq byte[] Concat to older .net Array with copy and Length considerations
- Linq query null check in data source
- display image path in DataGrid in WPF
- Sorting the items of a recursive list with "infinite" levels/generations
- Select single object from a query
- LINQ Returning Empty Collection Where ForEach Finds A Value
- How can I return a single value integer from Linq from an array of objects that have other nested values
- System.NotSupportedException: Can only project the last entity type in the query being translated
- How to use Rx to monitor a file for changes?
- Compare two lists and remove items that are not found in list2
- Linq query with many to many relations using entity framework
- Conditionally Adding Multiple Child XElements
- Why is construction taking a lot of time?
- Entity Framework Code First Dynamic Queries
- Get current enumerator (iterator ?) in LINQ query. Like a current index in for loops
- Can't use db.entry in my repository
- How to get control with minimal area from array of controls?
- how to order asc/dsc with lambda or linq
- Why does a null string concatenated to a non null string evaluate to null?
- JSON.NET use empty string when data is not available
- How can I use LINQ to retrieve entries that contain more than one property of a list within a list?
- LINQ & SQL Injection