Example #1
0
        public static bool DuckIs <T>(this object instance)
        {
            if (instance is null)
            {
                DuckTypeTargetObjectInstanceIsNull.Throw();
            }

            return(DuckType.CanCreate <T>(instance));
        }
Example #2
0
        public static bool DuckIs(this object instance, Type targetType)
        {
            if (instance is null)
            {
                DuckTypeTargetObjectInstanceIsNull.Throw();
            }

            if (targetType != null)
            {
                return(DuckType.CanCreate(targetType, instance));
            }

            return(false);
        }
        public static bool DuckIs <T>(this object instance)
        {
            if (instance is null)
            {
                DuckTypeTargetObjectInstanceIsNull.Throw();
            }

            if (DuckType.CreateCache <T> .IsVisible)
            {
                return(DuckType.CanCreate <T>(instance));
            }

            return(false);
        }