/// <summary> /// Sets the value of an attribute key in memory. Note, this will not persist value to database /// </summary> /// <param name="entity">The entity.</param> /// <param name="key">The key.</param> /// <param name="value">The value.</param> public static void SetAttributeValue(this Rock.Attribute.IHasAttributes entity, string key, DateTime?value) { if (value.HasValue) { entity.SetAttributeValue(key, value.Value.ToString("o")); } else { entity.SetAttributeValue(key, string.Empty); } }
/// <summary> /// Sets the value of an attribute key in memory. Note, this will not persist value to database /// </summary> /// <param name="entity">The entity.</param> /// <param name="key">The key.</param> /// <param name="value">The value.</param> public static void SetAttributeValue(this Rock.Attribute.IHasAttributes entity, string key, Guid?value) { entity.SetAttributeValue(key, value.ToString()); }