vivekj2004
asked on
C# enum
I want to use enums like this here, but cannot. Can somebody tell me what to do?
 CrcliEligibilityResponseDT O cliresp = new CrcliEligibilityResponseDT O();
if (a=1)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.A;
if (a=2)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.D;
if (a=3)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.P;
 CrcliEligibilityResponseDT
if (a=1)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.A;
if (a=2)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.D;
if (a=3)
cliresp.CLIAppDecPen = cliresp.CLIAppDecPen.P;
What's CrcliEligibilityResponseDT O.CLIAppDe cPen's type?
You can't use this same name for property and inner type. Change name od property or enum.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You're almost there, this should work (assumping the enum name is CLIAppDecPen):
CrcliEligibilityResponseDTO cliresp = new CrcliEligibilityResponseDTO();
if (a=1)
cliresp.CLIAppDecPen = CLIAppDecPen.A;
if (a=2)
cliresp.CLIAppDecPen = CLIAppDecPen.D;
if (a=3)
cliresp.CLIAppDecPen = CLIAppDecPen.P;
ASKER
I was forced to select a solution, that's why I selected this. Otherwose I don't want to give points to any solution. None of the solution was complete.