get const value

Sep 18, 2013 at 9:41 PM
whats the best way to get the values of

public static class SecurityOperations {
    public const string Read = "Read";
    public const string Write = "Write";
Coordinator
Sep 19, 2013 at 8:26 PM
I believe the following should do the trick:
    var read = (string) typeof(SecurityOperations).GetFieldValue("Read");
Or if you want to get all the constants:
    var fields = typeof(SecurityOperations).Fields().Where( f => f.IsLiteral );