下面的VB.NET枚举定义在C#中会是什么样的?
Public Enum SomeEnum As Integer
<Description("Name One")> NameOne = 1
End Enum
答案 0 :(得分:8)
public enum SomeEnum : int
{
[Description("Name One")] NameOne = 1
}
答案 1 :(得分:4)
public enum SomeEnum: int
{
[Description("Name One")]
NameOne = 1,
}
答案 2 :(得分:3)
尝试以下
enum SomeEnum
{
[Description("Name One")] NameOne = 1
}
答案 3 :(得分:2)
public enum SomeEnum : int
{
[Description("Name One")]
NameOne = 1
}
答案 4 :(得分:0)
public enum SomeEnum
{
[Description("Name One")]
NameOne = 1
}
答案 5 :(得分:0)
像这样: -
public enum SomeEnum
{
[Description("Name One")]
NameOne = 1;
}
答案 6 :(得分:0)
public enum SomeEnum : int
{
[Description("Name One")] NameOne = 1
}