Monday, 21 November 2016

c# - Get a enum value

I am stuck with a piece code
There is a object, a field of which returns an enum (getter) the field is set by a function after reading from database. For example



Enum fiscalperiond
{
Num1 = 12;
Num2 = 13;
}

Class A

{

Public Fiscalperiod
{
NumberOfFiscalPeriod {get;set;}
}
}


Now I want to do this how do I do it




A a = new A();

int k = a.NumberOfFiscalPeriod;

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...