c# - Asp.net MVC Handling Model Status -


ie: model called equipment responsible storing information equipments, , status.

my question is, efficient way store item's status. approach creating different model called equipmentstatus. when comes write code, need write code below :

if(equiment.equipmentstatusid == 2)  

i think not approach. best way ?

there nothing wrong in code if want in efficient way, use can enum.

also see great post. when use enum?

public enum status {     success = 1,     failed = 2,     default = 3 }  if(equiment.equipmentstatusid == (int)status.success) {  //something } 

Comments

Popular posts from this blog

python - SWIG function not printing output -

css - I want to align grid in center -

Contact Form PHP Email Script -