Question : Enumerable or Strongly typed List of Guids

So I have a list of Guids and thier String names I.E:

ee538d12-1de4-4a6f-a3dc-32840ea530e0 "ModifiedUser
fde92cb8-3d4f-4988-b80e-70701e5efeea, "ModifiedTicket"
ffc876ef-4177-4706-8fed-4f2d104769ba, "FailedToLogin"

I want to make them into a strognly typed list, I can do it with enums, but how can I do it with guids.

public enum UserGroups
        {
            ApplicationAdministrators = 1,
            User = 2,
            Manager = 3,
         }

I can call this by going UserGroups.Manager and it returns 3.

I want to do the same with the Guids and their string names.

LogTypes.ModifiedUser returns the Guid value.

Any Ideas?

Thanks.

Answer : Enumerable or Strongly typed List of Guids

Enum type can have only integral values (int, short, etc) and string values can not be used in enum...

See if using const will help you..

public struct LogTypes
{
public const string ModifiedUser  = "ee538d12-1de4-4a6f-a3dc-32840ea530e0";
public const string ModifiedTicket = "fde92cb8-3d4f-4988-b80e-70701e5efeea";
public const string FailedToLogin = "ffc876ef-4177-4706-8fed-4f2d104769ba";
}

With this you can use like LogTypes.ModifiedUser.

Random Solutions  
 
programming4us programming4us