public static PropertyExpression GetPropertyExpression(EktronPropertyAttribute attr) { PropertyMapBase map; if (attr.IsCustomProperty) { map = new CustomPropertyMap(); } else if (attr.IsSmartFormProperty) { map = new SmartFormPropertyMap(); } else if (attr.IsMetadataProperty) { map = new MetadataPropertyMap(); } else { map = new RegularPropertyMap(); } Func<string, PropertyExpression> factoryMethod = map.FirstOrDefault(attr.EktronExpressionType); return factoryMethod.Invoke(attr.EktronPropertyName); }
public static string GetPropertyName(EktronPropertyAttribute attr) { PropertyExpression propExpr = GetPropertyExpression(attr); return propExpr == null ? String.Empty : propExpr.Name; }