Class ObjectReflectionFormatter
- Namespace
- Sportradar.LiveData.Sdk.Common.Utils
- Assembly
- Sportradar.LiveData.Sdk.dll
Provides utilities for generating formatted string representations of object properties using reflection.
public static class ObjectReflectionFormatter
- Inheritance
-
ObjectReflectionFormatter
- Inherited Members
Methods
FormatPropertiesInline<T>(T)
Formats the properties of the specified object into a single line string. Each property is represented in the format "key=value" and separated by commas. Null or empty properties are omitted.
public static string FormatPropertiesInline<T>(T obj)
Parameters
objTThe object whose properties are to be formatted.
Returns
- string
A string representation of the object with properties in a single line.
Type Parameters
TThe type of the object to format.
FormatPropertiesWithNewLine<T>(T)
Formats the properties of the specified object with each property on a new line. Properties are presented in the format "PropertyName: PropertyValue". Null or empty properties are omitted.
public static string FormatPropertiesWithNewLine<T>(T obj)
Parameters
objTThe object whose properties are to be formatted.
Returns
- string
A string representation of the object with properties on separate lines.
Type Parameters
TThe type of the object to format.