UtilJsonApiSerializer.Serialization.JsonApiFormatter.CanWriteType C# (CSharp) Method

CanWriteType() public method

public CanWriteType ( Type type ) : bool
type System.Type
return bool
        public override bool CanWriteType(Type type)
        {
            if (type == typeof (CompoundDocument))
            {
                return true;
            }

            if (type == typeof (HttpError))
            {
                return true;
            }

            if ((typeof(Exception).IsAssignableFrom(type)))
            {
                return true;
            }

            if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(MetaDataWrapper<>))
            {
                type = type.GenericTypeArguments[0];
            }

            return configuration.IsMappingRegistered(type);
        }