跳到主要内容
版本:dev

Supported Types

This page summarizes built-in and generated type support in Apache Fory™ C#.

Primitive Types

C# TypeNotes
boolSupported
sbyte, short, int, longSupported
byte, ushort, uint, ulongSupported
float, doubleSupported
stringSupported
byte[]Supported
Nullable primitives (for example int?)Supported

Arrays

  • Primitive numeric arrays (bool[], int[], ulong[], etc.)
  • byte[]
  • General arrays (T[]) through collection serializers

Collections

List-like

  • List<T>
  • LinkedList<T>
  • Queue<T>
  • Stack<T>

Set-like

  • HashSet<T>
  • SortedSet<T>
  • ImmutableHashSet<T>

Map-like

  • Dictionary<TKey, TValue>
  • SortedDictionary<TKey, TValue>
  • SortedList<TKey, TValue>
  • ConcurrentDictionary<TKey, TValue>
  • NullableKeyDictionary<TKey, TValue>

Time Types

C# TypeWire Type
DateOnlyDate
DateTimeTimestamp
DateTimeOffsetTimestamp
TimeSpanDuration

User Types

  • [ForyObject] classes/structs/enums via source-generated serializers
  • Custom serializer types registered through Register<T, TSerializer>(...)
  • Union / Union2<...> typed union support

Dynamic Types

Dynamic object payloads via Serialize<object?> / Deserialize<object?> support:

  • Primitive/object values
  • Dynamic lists/sets/maps
  • Nested dynamic structures

Notes

  • User-defined types should be registered explicitly.
  • For cross-language usage, follow the xlang guide.