﻿using System;

namespace Carbon.Data.Sql
{
    internal static class ObjectHelper
    {
        public static bool IsInteger(object instance)
        {
            if (instance is null) return false;

            switch (Type.GetTypeCode(instance.GetType()))
            {
                case TypeCode.Byte:
                case TypeCode.SByte:
                case TypeCode.Int16:
                case TypeCode.Int32:
                case TypeCode.Int64:
                case TypeCode.UInt16:
                case TypeCode.UInt32:
                    return true;
            }

            return false;
        }
    }
}
