How to change enum definition without impacting clients using it in C#

Posted by Rohit on Stack Overflow See other posts from Stack Overflow or by Rohit
Published on 2010-06-14T12:22:27Z Indexed on 2010/06/14 12:32 UTC
Read the original article Hit count: 176

Filed under:
|

I have the following enum defined. I have used underscores as this enum is used in logging and i don't want to incur the overhead of reflection by using custom attribute.We use very heavy logging. Now requirement is to change "LoginFailed_InvalidAttempt1" to "LoginFailed Attempt1". If i change this enum, i will have to change its value across application. I can replace underscore by a space inside logging SP. Is there any way by which i can change this without affecting whole application.Please suggest.

public enum ActionType
{
    None,
    Created,
    Modified,
    Activated,
    Inactivated,
    Deleted,
    Login,
    Logout,
    ChangePassword,
    ResetPassword,
    InvalidPassword,
    LoginFailed_LockedAccount,
    LoginFailed_InActiveAccount,
    LoginFailed_ExpiredAccount,
    ForgotPassword,
    LoginFailed_LockedAccount_InvalidAttempts,
    LoginFailed_InvalidAttempt1,
    LoginFailed_InvalidAttempt2,
    LoginFailed_InvalidAttempt3,
    ForgotPassword_InvalidAttempt1,
    ForgotPassword_InvalidAttempt2,
    ForgotPassword_InvalidAttempt3,
    SessionTimeOut,
    ForgotPassword_LockedAccount,
    LockedAccount,
    ReLogin,
    ChangePassword_Due_To_Expiration,
    ChangePassword_AutoExpired

}

© Stack Overflow or respective owner

Related posts about c#

Related posts about c#3.0