Ejemplo n.º 1
0
        /// <summary>Returns the EPM facet or null if none is found.</summary>
        /// <param name="facets">The facets to look into.</param>
        /// <returns>null - no EPM or the EPM type.</returns>
        public static EntityPropertyMappingType?EntityPropertyMapping(this NodeFacets facets)
        {
            NodeFacet facet = facets.FirstOrDefault(f => f.Name == EntityPropertyMappingFacetName);

            if (facet != null)
            {
                return((EntityPropertyMappingType)(int)(facet.Value.ClrValue));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
        /// <summary>Returnst the page size of Server Driven Paging facet or null if none is found.</summary>
        /// <param name="facets">The facets to look into.</param>
        /// <returns>The size of the page or null.</returns>
        public static int?ServerDrivenPaging(this NodeFacets facets)
        {
            NodeFacet facet = facets.FirstOrDefault(f => f.Name == ServerDrivenPagingFacetName);

            return(facet == null ? null : (int?)(facet.Value.ClrValue));
        }
Ejemplo n.º 3
0
        /// <summary>Returns the value of "ExistingValue" node facet. Use to specify a value of a property which is defined in at least one entity.</summary>
        /// <param name="facets">The facets to get the value from.</param>
        /// <returns>A <see cref="NodeValue"/> with the value of the property.</returns>
        public static NodeValue ExistingValue(this NodeFacets facets)
        {
            NodeFacet facet = facets.FirstOrDefault(f => f.Name == ExistingValueFacetName);

            return(facet == null ? null : facet.Value);
        }