public static int AsInt(this RedisResult val) { if (val == null) { return(0); } if (val.HasValue() && !val.IsNull && !val.IsEmpty()) { return(Convert.ToInt32(val.ToString())); } return(0); }