tags:

views:

220

answers:

7

What would the folowing VB.NET enum definition look like in C#?

Public Enum SomeEnum As Integer
    <Description("Name One")> NameOne = 1
End Enum
+8  A: 
public enum SomeEnum : int
{
    [Description("Name One")] NameOne = 1
}
dtb
The `: int` part can be left out, as that would be the default.
P Daddy
+3  A: 

Try the following

enum SomeEnum
{
    [Description("Name One")] NameOne = 1
}
JaredPar
+2  A: 
public enum SomeEnum : int
{
[Description("Name One")]
NameOne = 1
}
statichippo
(although the :int isn't actually necessary)
statichippo
+4  A: 
public enum SomeEnum: int
{
    [Description("Name One")]
    NameOne = 1,
}
Ozgur Ozcitak
A: 
public enum SomeEnum 
{
[Description("Name One")]
NameOne = 1
}
Yurec
A: 

Like this:-

public enum SomeEnum
{
   [Description("Name One")]
   NameOne = 1;
}
AnthonyWJones
A: 
public enum SomeEnum : int 
{ 
    [Description("Name One")] NameOne = 1 
} 
Younes