src/Misc/EFTools/EntityDesignDatabaseGeneration/EdmExtensions.cs
/// <summary>
///     Converts a string representation of store schema definition language (SSDL) to a <see cref="StoreItemCollection" /> and validates it.
/// </summary>
/// <param name="ssdl">SSDL as a string.</param>
/// <param name="targetFrameworkVersion">The targeted version of the Entity Framework.</param>
/// <param name="resolver">The dependency resolver to use for loading required dependencies.</param>
/// <param name="catchThrowNamingConflicts">
///     Determines if exceptions should be thrown if a naming conflict exists in the generated
///     <see
///         cref="StoreItemCollection" />
///     .
/// </param>
/// <returns>
///     SSDL as a <see cref="StoreItemCollection" />.
/// </returns>
Converts a string representation of store schema definition language (SSDL) to a  and validates it.
Converts a string representation of store schema definition language ( SSDL ) to a and validates it .
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "ssdl")]
        public static StoreItemCollection CreateAndValidateStoreItemCollection(
            string ssdl, Version targetFrameworkVersion, IDbDependencyResolver resolver, bool catchThrowNamingConflicts)
        {
            IList<EdmSchemaError> ssdlErrors;
            var storeItemCollection = CreateStoreItemCollection(ssdl, targetFrameworkVersion, resolver, out ssdlErrors);
            if (ssdlErrors != null
                && ssdlErrors.Count > 0)
            {
                if (catchThrowNamingConflicts)
                {
                    var namingError = ssdlErrors.FirstOrDefault(e => e.ErrorCode == 19);
                    if (namingError != null)
                    {
                        var namingErrorException =
                            new InvalidOperationException(
                                String.Format(CultureInfo.CurrentCulture, Resources.ErrorNameCollision, namingError.Message));
                        namingErrorException.Data.Add(SsdlErrorExDataKey, ssdlErrors);
                        throw namingErrorException;
                    }
                }
                var invalidSsdlException =
                    new InvalidOperationException(
                        String.Format(
                            CultureInfo.CurrentCulture,
                            Resources.ErrorNonValidSsdl,
                            string.Join(Environment.NewLine, ssdlErrors.Select(e => e.Message))));
                invalidSsdlException.Data.Add(SsdlErrorExDataKey, ssdlErrors);
                throw invalidSsdlException;
            }
            return storeItemCollection;
        }
[ SuppressMessage ( " " , " " , MessageId = " " ) ] public static StoreItemCollection CreateAndValidateStoreItemCollection ( string ssdl , Version targetFrameworkVersion , IDbDependencyResolver resolver , bool catchThrowNamingConflicts ) { IList < EdmSchemaError > ssdlErrors ; var storeItemCollection = CreateStoreItemCollection ( ssdl , targetFrameworkVersion , resolver , out ssdlErrors ) ; if ( ssdlErrors != null && ssdlErrors . Count > 0 ) { if ( catchThrowNamingConflicts ) { var namingError = ssdlErrors . FirstOrDefault ( e => e . ErrorCode == 19 ) ; if ( namingError != null ) { var namingErrorException = new InvalidOperationException ( String . Format ( CultureInfo . CurrentCulture , Resources . ErrorNameCollision , namingError . Message ) ) ; namingErrorException . Data . Add ( SsdlErrorExDataKey , ssdlErrors ) ; throw namingErrorException ; } } var invalidSsdlException = new InvalidOperationException ( String . Format ( CultureInfo . CurrentCulture , Resources . ErrorNonValidSsdl , string . Join ( Environment . NewLine , ssdlErrors . Select ( e => e . Message ) ) ) ) ; invalidSsdlException . Data . Add ( SsdlErrorExDataKey , ssdlErrors ) ; throw invalidSsdlException ; } return storeItemCollection ; }
Converts a string representation of store schema definition language (SSDL) to a  and validates it.
Converts a string representation of store schema definition language ( SSDL ) to a and validates it .
// Make sure the StoreItemCollection was created (validate it) otherwise the next stage will not proceed // having the caller catch, parse the SSDL errors, and rethrow an exception is expensive;  // we'll just throw a special one here instead
SSDL as a .
SSDL as a .
ssdl
string
SSDL as a string.
SSDL as a string .
targetFrameworkVersion
Version
The targeted version of the Entity Framework.
The targeted version of the Entity Framework .
resolver
IDbDependencyResolver
The dependency resolver to use for loading required dependencies.
The dependency resolver to use for loading required dependencies .
catchThrowNamingConflicts
bool
Determines if exceptions should be thrown if a naming conflict exists in the generated


Determines if exceptions should be thrown if a naming conflict exists in the generated