I have an enum type defined like so:
public enum Status { Active=1, InActive=0 } in my method can I cast the parameter into the enum like this:
public string doSomething(string param1, int status) { //will this work? Account.Status = (Status) status; //or do i need to test one by one like this if(status == 0) { Account.Status = Status.Inactive; //and so on... } // end if } // end doSomething
int, but notenum.