Skip to content

ObjectExtensions Class ​

Definition ​

Extension methods for Objects

  • Namespace: JASE.Extensions
  • Assembly: JASE.dll

Methods ​

NameDescription
long EstimateSize(object obj)Estimates the memory consumed by an object
List<string> GetProperties(object source, bool excludeNullValues = null)Returns a list of property names defined on the source object
T GetProperty(ExpandoObject eo, string key)Retrieves the value of a property from an ExpandoObject using the specified key. Returns the value cast to the specified type, or default if not found or type mismatch.
object GetProperty(T obj, string name)Retrieves the value of a property from either a POCO or an ExpandoObject using the specified name.
byte[] GetShaHash(object input, HashProvider hash = null)Returns SHA hash of the JSON string representing the input object using the requested HashProvider
void SetProperty(T obj, string name, object value)Sets the value of a property on a POCO or an ExpandoObject.
IDictionary<string, T> ToPropertyDictionary(object source, bool supportJsonPropertyName = null, bool supportJsonIgnore = null, bool camelCasePropertyNames = null)Serialize object to Dictionary
IDictionary<string, object> ToPropertyDictionary(object source, bool supportJsonPropertyName = null, bool supportJsonIgnore = null, bool camelCasePropertyNames = null)Serialize object to Dictionary