/// <summary> /// Gets a list of AttributeIds for the specified entityTypeId /// </summary> /// <param name="entityTypeId">The entity type identifier.</param> /// <returns></returns> internal static List <EntityAttributes> GetByEntity(int?entityTypeId) { var allEntityAttributes = EntityAttributesCache.Get(); if (allEntityAttributes != null) { List <EntityAttributes> result; if (entityTypeId.HasValue) { result = allEntityAttributes.EntityAttributesByEntityTypeId.GetValueOrNull(entityTypeId.Value) ?? new List <EntityAttributes>(); } else { result = allEntityAttributes.EntityAttributes.Where(a => !a.EntityTypeId.HasValue).ToList(); } return(result); } return(new List <EntityAttributes>()); }
/// <summary> /// Updates the <see cref="EntityAttributesCache" /> based on the attribute and entityState /// </summary> /// <param name="attribute">The attribute.</param> /// <param name="entityState">State of the entity.</param> internal static void UpdateCacheEntityAttributes(Rock.Model.Attribute attribute, EntityState entityState) { EntityAttributesCache.UpdateCacheEntityAttributes(attribute, entityState); }
public static void FlushEntityAttributes() { EntityAttributesCache.Remove(); }