public void Name_keyword_is_parsed_correctly_in_named_connection_string()
        {
            var options = new DbConnectionOptions("Name=Suburbia", EntityConnectionStringBuilder.ValidKeywords);

            Assert.Equal("Suburbia", options.Parsetable[EntityConnectionStringBuilder.NameParameterName]);
            Assert.Equal("Suburbia", options[EntityConnectionStringBuilder.NameParameterName]);
            Assert.Null(options[EntityConnectionStringBuilder.ProviderParameterName]);
        }
        public void All_other_keywords_are_parsed_correctly_in_non_named_connection_string()
        {
            var options =
                new DbConnectionOptions(
                    "Metadata=DjCulture; Provider=Its.A.Sin; Provider Connection String='Database=Domino Dancing'",
                    EntityConnectionStringBuilder.ValidKeywords);

            Assert.Equal("DjCulture", options.Parsetable[EntityConnectionStringBuilder.MetadataParameterName]);
            Assert.Equal("Its.A.Sin", options.Parsetable[EntityConnectionStringBuilder.ProviderParameterName]);
            Assert.Equal("Database=Domino Dancing", options.Parsetable[EntityConnectionStringBuilder.ProviderConnectionStringParameterName]);
        }
        public MetadataArtifactLoader GetArtifactLoader(DbConnectionOptions effectiveConnectionOptions)
        {
            DebugCheck.NotNull(effectiveConnectionOptions);

            var paths = effectiveConnectionOptions[EntityConnectionStringBuilder.MetadataParameterName];

            if (!string.IsNullOrEmpty(paths))
            {
                var loaders = _artifactLoaderCache.Evaluate(paths);

                return MetadataArtifactLoader.Create(
                    ShouldRecalculateMetadataArtifactLoader(loaders)
                        ? SplitPaths(paths)
                        : loaders);
            }

            return MetadataArtifactLoader.Create(new List<MetadataArtifactLoader>());
        }
        public MetadataWorkspace GetMetadataWorkspace(DbConnectionOptions effectiveConnectionOptions)
        {
            DebugCheck.NotNull(effectiveConnectionOptions);

            var artifactLoader = GetArtifactLoader(effectiveConnectionOptions);

            var cacheKey = CreateMetadataCacheKey(
                artifactLoader.GetPaths(),
                effectiveConnectionOptions[EntityConnectionStringBuilder.ProviderParameterName]);

            return GetMetadataWorkspace(cacheKey, artifactLoader);
        }