The following question shows how to implement an interface that contains a class in java:
The code in Java is:
public interface A {
class B {
}
}
I was hoping the same thing was possible in C#, though I haven't yet been able to get anything working.
For reference, I have a class which makes lookups of key values, but the keys aren't named in a way that makes them easy to understand. I'd like to have a compile time lookup for keys, so the interface would be something like:
interface Lookup {
class Keys {
string SomeKey() => "0"
}
}
Which means I suppose I have two questions:
- Is it possible to have an interface containing a class?
- Is there a better way of having a lookup between two strings (or any other values) that I can reference reliably at compile time?