/// <summary> /// Tries to get the value. /// </summary> /// <param name="object">The @object.</param> /// <param name="key">The key.</param> /// <param name="value">The value.</param> /// <returns>True if it is found, false otherwise.</returns> private bool TryGetValue(TClass @object, int key, out object?value) { if (!GetProperties.ContainsKey(key)) { value = null; return(false); } value = GetProperties[key](@object); return(true); }
/// <summary> /// Tries to get the value. /// </summary> /// <param name="object">The object.</param> /// <param name="propertyName">Name of the property.</param> /// <param name="value">The value.</param> /// <returns>True if it is a property, false otherwise.</returns> public bool TryGetValue(Dynamo @object, string propertyName, out object?value) { if (@object is null) { value = null; return(false); } var Key = propertyName.GetHashCode(StringComparison.OrdinalIgnoreCase); if (!GetProperties.ContainsKey(Key)) { value = null; return(false); } value = GetProperties[Key]((@object as TClass) !); return(true); }