This project has moved and is read-only. For the latest updates, please go here.

get const value

Sep 18, 2013 at 10: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";
Sep 19, 2013 at 9: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 );