I'm trying to build a way to get the key for a given piece of text in a given resx file at runtime.
Currently, I can open and read the file (Using ResXResourceReader) but I have to use a foreach to go over the entire file.
This could be a performance issue, as some of our resx files are fairly large (in the order of 2000 strings) and we may be doing this frequently.
I'd like to use LINQ to Objects to query this, as I assume the 'where' extension is relatively optimized, however I've been unable to do so. The ResXResourceReader class has two methods 'AsQueryable()' and 'GetEnumerator()', but neither allow LINQ against their result (so 'from n in reader.AsQueryable() where' fails).
How can I LINQ against something provided by the ResXResourceReader, or is it even worth the time?