Given this listing
public enum UserStatus : byte { Approved = 1, Locked = 2, Expire = 3 }
why this check always returns false when usr.Status = 1
if(usr.Status.Equals(UserStatus.Approved)) return true; return false;
The comparison seems to work - there is no compile-time error or runtime exception. Please note that I am not the author of this piece of code and would like to know why the author chose an enumeration of type byte and why this does not work as it should.
source share