Zeeshan  Azim

Zeeshan Azim

  • 668
  • 1.2k
  • 13.5k

How to implement enum from database

Feb 19 2016 6:22 AM
I have several status in my projects
i.e Select StatusName from  Status
 
I want to implement enums from database dynamically without T4. For example if I add a record in database table It should automatically reflect in my enum or on other hand if I update the same it should reflect that as well.  
 
My sample enum is mentioned below
 
 
public enum Status
{
Pending = 1,
Approved = 2,
Rejected = 3,
Cancelled = 4,
Closed = 5,
Update = 7,
Draft = 8,
FLMPending = 9,
FINPending = 10,
HeadPending = 11,
Complete = 12,
OnHold = 13,
FundTransfer = 14,
Received = 15,
UnSettle = 16
};
 
 

Answers (3)