public IEnumerable <Type> GetSubTypes(Type type, out HashSet <Type>?visited) { if (type.IsValueType || type.IsArray || _typeModel.CanSerializeBasicType(type)) { visited = null; return(Type.EmptyTypes); } visited = new HashSet <Type>(); return(Visit(type, _typeModel, visited));
private bool IsPrimitive(Type type) { return(type == null || type.IsPrimitive || _model.CanSerializeBasicType(type) || _builtTypes.ContainsKey(type) || ComplexPrimitives.Contains(type)); }