HttpServer.Check.Type C# (CSharp) Method

Type() public static method

Check if the specified type can be assigned from the parameter type.
public static Type ( Type type, object instance, string messageOrParamName ) : void
type Type Type that the parameter must be (or derive/implement).
instance object instance
messageOrParamName string error message or parameter name
return void
        public static void Type(Type type, object instance, string messageOrParamName)
        {
            if (type.IsAssignableFrom(instance.GetType()))
                return;

            Throw(messageOrParamName, FieldType, type.ToString());
        }