Rebel.Cms.Web.PropertyEditorExtensions.ToPropertyEditorDefinitions C# (CSharp) Method

ToPropertyEditorDefinitions() static private method

Converts a list of real property editors to property editor definitions
TODO: This is a helper class which is used for tests and demo data, this may not be required in the future except for unit tests
static private ToPropertyEditorDefinitions ( this props ) : PropertyEditorMetadata>>.IEnumerable
props this
return PropertyEditorMetadata>>.IEnumerable
        internal static IEnumerable<Lazy<PropertyEditor, PropertyEditorMetadata>> ToPropertyEditorDefinitions(this IEnumerable<PropertyEditor> props)
        {
            //convert to Lazy<PropertyEditor, PropertyEditorMetadata>
            return (from p in props
                    let prop = p
                    let data = new Dictionary<string, object>
                                                 {
                                                     { "Name", p.Name }, 
                                                     { "Alias", p.Alias },
                                                     { "Id", p.Id },
                                                     { "ComponentType", p.GetType()},
                                                     { "PluginDefinition", null }
                                                 }
                    select new Lazy<PropertyEditor, PropertyEditorMetadata>(() => prop, new PropertyEditorMetadata(data))).ToList();
        }
    }