Class TreeObjectConverter
Utility class for converting between RedbObject and TreeRedbObject types.
Provides static methods for type conversion and parent chain building.
public static class TreeObjectConverter
Inheritance
Methods
BuildParentRelationships(IEnumerable<ITreeRedbObject>)
Build Parent relationships for a collection of polymorphic tree objects.
public static void BuildParentRelationships(IEnumerable<ITreeRedbObject> objects)
BuildParentRelationships<TProps>(IEnumerable<TreeRedbObject<TProps>>)
Build Parent relationships for a collection of tree objects.
public static void BuildParentRelationships<TProps>(IEnumerable<TreeRedbObject<TProps>> objects) where TProps : class, new()
ToTreeObject<TProps>(IRedbObject)
Convert IRedbObject to TreeRedbObject (creates new instance with Props = new TProps if types don't match).
public static TreeRedbObject<TProps> ToTreeObject<TProps>(IRedbObject source) where TProps : class, new()
ToTreeObject<TProps>(RedbObject<TProps>)
Convert RedbObject to TreeRedbObject preserving all properties.
public static TreeRedbObject<TProps> ToTreeObject<TProps>(RedbObject<TProps> source) where TProps : class, new()
ToTreeObjectDynamic(IRedbObject)
Convert IRedbObject to ITreeRedbObject dynamically preserving actual Props type.
public static ITreeRedbObject ToTreeObjectDynamic(IRedbObject source)