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

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -