Exemplo n.º 1
0
        /// <summary>
        /// Gets the provider manifest token.
        /// </summary>
        /// <param name="connection">The database connection.</param>
        /// <returns>Provider Manfiest Token suitable for inclusion in SSDL file and connection string</returns>
        /// <remarks>
        /// The provider manifest token is created by concatenating wrapped provider invariant name and its
        /// token separated by semicolon, for example when wrapping SqlClient for SQL Server 2005 the provider
        /// manifest token will be "System.Data.SqlClient;2005"
        /// </remarks>
        protected override string GetDbProviderManifestToken(DbConnection connection)
        {
            DbConnectionWrapper wrapper           = (DbConnectionWrapper)connection;
            DbConnection        wrappedConnection = wrapper.WrappedConnection;

            System.Data.Entity.Core.Common.DbProviderServices services = System.Data.Entity.Core.Common.DbProviderServices.GetProviderServices(wrappedConnection);

            string token = wrapper.WrappedProviderInvariantName + ";" + services.GetProviderManifestToken(wrappedConnection);

            return(token);
        }