Exemplo n.º 1
0
 GetTextPropertiesForEntity(IDataType dataType)
 {
     if (dataType != null)
     {
         return(dataType.Properties.Where(
                    p => CustomEditorHelper.IsTextProperty(p)
                    ).Cast <IPropertyDefinition>());
     }
     return(Enumerable.Empty <IPropertyDefinition>());
 }
Exemplo n.º 2
0
    private static IEntityPropertyDefinition GetFirstEntityProperty(
        IEntityType entityType)
    {
        // Simple types are non business types/ non navigation properties
        IEnumerable <IEntityPropertyDefinition> simpleTypeProperties =
            entityType.Properties.Where(p => p.PropertyType is ISimpleType);

        // Find the first string property, or the first one that can
        // be represented as a string
        IEntityPropertyDefinition defaultSummaryProperty =
            simpleTypeProperties.FirstOrDefault(
                p => CustomEditorHelper.GetBaseSystemType(
                    (ISimpleType)p.PropertyType) == typeof(string)) ??
            simpleTypeProperties.FirstOrDefault(
                p => CustomEditorHelper.IsTextProperty(p));

        return(defaultSummaryProperty);
    }