Here is the situation.
I have some objects that contain:
- a starting
long
- an ending
long
- a
string
code
These objects longs
are sequential.
For example:
var obj1 = new {From = 0, To = 16777215, Code = "aaa"};
var obj2 = new {From = 16777216, To = 16777471, Code = "bbb"};
there are almost 150.000 objects like this.
For the moment I store everything in a SQL table.
The issue is I need to search from this list. For example, I need to look for the object with the number 16777470, which will be the object 2 "bbb".
Question : Is there an efficient way to store such an amount of objects in memory and being able to seek for elements in it, having a long and looking for the closest element ?