示例#1
0
        public virtual IModel GetMetadataModel([NotNull] ReverseEngineeringConfiguration configuration)
        {
            Check.NotNull(configuration, nameof(configuration));

            var metadataModel = _provider.GenerateMetadataModel(
                configuration.ConnectionString, configuration.TableSelectionSet);

            if (metadataModel == null)
            {
                throw new InvalidOperationException(
                          RelationalDesignStrings.ProviderReturnedNullModel(
                              _provider.GetType().FullName,
                              configuration.ConnectionString));
            }

            return(metadataModel);
        }
        public virtual IModel GetMetadataModel(
            [NotNull] IDatabaseMetadataModelProvider provider,
            [NotNull] ReverseEngineeringConfiguration configuration)
        {
            Check.NotNull(provider, nameof(provider));
            Check.NotNull(configuration, nameof(configuration));

            var metadataModel = provider
                                .GenerateMetadataModel(configuration.ConnectionString);

            if (metadataModel == null)
            {
                throw new InvalidOperationException(
                          Strings.ProviderReturnedNullModel(
                              provider.GetType().FullName,
                              configuration.ConnectionString));
            }

            return(metadataModel);
        }