public static bool ParseBool()

in Darabonba/Utils/ConverterUtils.cs [121:147]


        public static bool ParseBool<T>(T data)
        {
            if (data == null)
            {
                throw new DaraException
                {
                    Message = "Data is null.."
                };
            }

            var stringValue = data.ToString();

            if (stringValue.Equals("true", StringComparison.OrdinalIgnoreCase) ||
                stringValue.Equals("1"))
            {
                return true;
            }
            if (stringValue.Equals("false", StringComparison.OrdinalIgnoreCase) ||
                     stringValue.Equals("0"))
            {
                return false;
            }
            throw new DaraException
            {
                Message = "Cannot convert data to bool."
            };
        }