src/Misc/EFTools/EntityDesignDatabaseGeneration/MetadataWorkspaceExtensions.cs
/// <summary>
///     Infer SSDL facets from a CSDL property
/// </summary>
/// <param name="csdlProperty">The CSDL property.</param>
/// <param name="providerManifest">The DbProviderManifest to use.</param>
/// <returns>The list of facets.</returns>
Infer SSDL facets from a CSDL property
Infer SSDL facets from a CSDL property
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Csdl")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "csdl")]
        [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Ssdl")]
        [SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
        public static IEnumerable<Facet> InferSsdlFacetsForCsdlProperty(this EdmProperty csdlProperty, DbProviderManifest providerManifest)
        {
            var storeType = csdlProperty.GetStoreTypeUsage(providerManifest);
            Dictionary<string, Facet> storeFacetLookup = storeType.Facets.ToDictionary(f => f.Name, f => f);
            return
                csdlProperty.TypeUsage.Facets.Where(
                    f =>
                    (storeFacetLookup.ContainsKey(f.Name) && storeFacetLookup[f.Name].Description.IsConstant == false
                     && !"IsStrict".Equals(f.Name, StringComparison.Ordinal)));
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] [ SuppressMessage ( " " , " " , MessageId = " " ) ] [ SuppressMessage ( " " , " " , MessageId = " " ) ] [ SuppressMessage ( " " , " " ) ] public static IEnumerable < Facet > InferSsdlFacetsForCsdlProperty ( this EdmProperty csdlProperty , DbProviderManifest providerManifest ) { var storeType = csdlProperty . GetStoreTypeUsage ( providerManifest ) ; Dictionary < string , Facet > storeFacetLookup = storeType . Facets . ToDictionary ( f => f . Name , f => f ) ; return csdlProperty . TypeUsage . Facets . Where ( f => ( storeFacetLookup . ContainsKey ( f . Name ) && storeFacetLookup [ f . Name ] . Description . IsConstant == false && ! " " . Equals ( f . Name , StringComparison . Ordinal ) ) ) ; }
Infer SSDL facets from a CSDL property
Infer SSDL facets from a CSDL property
// Note that there are some facets that exist in the C-side but not in the store side (Collation/ConcurrencyMode) // Also the IsStrict facet can exist on the C-side but should not be used on the S-side despite the fact that e.g. SqlServer.geometry defines that facet
The list of facets.
The list of facets .
EdmProperty
this
providerManifest
DbProviderManifest
The DbProviderManifest to use.
The DbProviderManifest to use .
csdlProperty
The CSDL property.
The CSDL property .