System.Data.Common.DbProviderServices.GetProviderServices(System.Data.Common.DbConnection)

Here are the examples of the csharp api class System.Data.Common.DbProviderServices.GetProviderServices(System.Data.Common.DbConnection) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

14 Examples 7

1. Example

View license
private static TResult ReliableWrappedCall<TResult>(DbConnection connection, Func<DbProviderServices, DbConnection, TResult> callToReliablyWrap)
        {
            var reliableConnection = (ReliableSqlDbConnection)connection;
            var underlyingConnection = reliableConnection.ReliableConnection.Current;
            return reliableConnection.ReliableConnection.CommandRetryPolicy.ExecuteAction(
                () => callToReliablyWrap(GetProviderServices(underlyingConnection), underlyingConnection)
            );
        }

2. Example

View license
internal static ObjectQueryExecutionPlan Prepare(ObjectContext context, DbQueryCommandTree tree, Typ/n ..... /n //View Source file for more details /n }

3. Example

Project: referencesource
Source File: ObjectContext.cs
View license
public void CreateDatabase()
        {
            DbConnection storeConnection = this._connection.StoreConnection;
            DbProviderServices services = DbProviderServices.GetProviderServices(this.GetStoreItemCollection().StoreProviderFactory);
            services.CreateDatabase(storeConnection, this.CommandTimeout, this.GetStoreItemCollection());
        }

4. Example

Project: referencesource
Source File: ObjectContext.cs
View license
public void DeleteDatabase()
        {
            DbConnection storeConnection = this._connection.StoreConnection;
            DbProviderServices services = DbProviderServices.GetProviderServices(this.GetStoreItemCollection().StoreProviderFactory);
            services.DeleteDatabase(storeConnection, this.CommandTimeout, this.GetStoreItemCollection());
        }

5. Example

Project: referencesource
Source File: ObjectContext.cs
View license
public bool DatabaseExists()
        {
            DbConnection storeConnection = this._connection.StoreConnection;
            DbProviderServices services = DbProviderServices.GetProviderServices(this.GetStoreItemCollection().StoreProviderFactory);
            return services.DatabaseExists(storeConnection, this.CommandTimeout, this.GetStoreItemCollection());
        }

6. Example

Project: referencesource
Source File: ObjectContext.cs
View license
public String CreateDatabaseScript()
        {
            DbProviderServices services = DbProviderServices.GetProviderServices(this.GetStoreItemCollection().StoreProviderFactory);
            string targetProviderManifestToken = this.GetStoreItemCollection().StoreProviderManifestToken;
            return services.CreateDatabaseScript(targetProviderManifestToken, this.GetStoreItemCollection());
        }

7. Example

View license
internal DbDataReader ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
  /n ..... /n //View Source file for more details /n }

8. Example

View license
private void InitializeProviderManifest(Action<string, ErrorCode, EdmSchemaErrorSeverity> addE/n ..... /n //View Source file for more details /n }

9. Example

Project: referencesource
Source File: SpatialHelpers.cs
View license
internal static DbSpatialDataReader CreateSpatialDataReader(MetadataWorkspace workspace, DbDataReader reader)
        {
            StoreItemCollection storeItemCollection = (StoreItemCollection)workspace.GetItemCollection(DataSpace.SSpace);
            DbProviderFactory providerFactory = storeItemCollection.StoreProviderFactory;
            Debug.Assert(providerFactory != null, "GetProviderSpatialServices requires provider factory to have been initialized");

            DbProviderServices providerServices = DbProviderServices.GetProviderServices(providerFactory);
            DbSpatialDataReader result = providerServices.GetSpatialDataReader(reader, storeItemCollection.StoreProviderManifestToken);
            Debug.Assert(result != null, "DbProviderServices did not throw ProviderIncompatibleException for null IDbSpatialDataReader");

            return result;
        }

10. Example

Project: referencesource
Source File: CommandHelper.cs
View license
private static object GetSpatialValueFromProviderValue(object spatialValue, PrimitiveType parameterType, EntityConnection connection)
        {
            DbProviderServices providerServices = DbProviderServices.GetProviderServices(connection.StoreConnection);
            StoreItemCollection storeItemCollection = (StoreItemCollection)connection.GetMetadataWorkspace().GetItemCollection(DataSpace.SSpace);
            DbSpatialServices spatialServices = providerServices.GetSpatialServices(storeItemCollection.StoreProviderManifestToken);
            if (Helper.IsGeographicType(parameterType))
            {
                return spatialServices.GeographyFromProviderValue(spatialValue);
            }
            else
            {
                Debug.Assert(Helper.IsGeometricType(parameterType));
                return spatialServices.GeometryFromProviderValue(spatialValue);
            }
        }

11. Example

View license
private DataTable GetCurrentSchema(bool preferSilent)
        {
            // Verify that we have v/n ..... /n //View Source file for more details /n }

12. Example

View license
public override IEnumerable<MigrationStatement> Generate(IEnumerable<MigrationOperation> migrationOperations, string providerManifestToken)
    {      
      MySqlConnection con = new MySqlConnection();
      List<MigrationStatement> stmts = new List<MigrationStatement>();
      _providerManifestToken = providerManifestToken;
      _providerManifest = DbProviderServices.GetProviderServices(con).GetProviderManifest(providerManifestToken);
      
      //verify if there is one or more add/alter column operation, if there is then look for primary key operations. Alter in case that the user wants to change the current PK column
      if ((from cols in migrationOperations.OfType<AddColumnOperation>() select cols).Count() > 0 || (from cols in migrationOperations.OfType<AlterColumnOperation>() select cols).Count() > 0)
        _pkOperations = (from pks in migrationOperations.OfType<AddPrimaryKeyOperation>() select pks).ToList();

      foreach (MigrationOperation op in migrationOperations)
      {
        if (!_dispatcher.ContainsKey(op.GetType().Name))
          throw new NotImplementedException(op.GetType().Name);
        OpDispatcher opdis = _dispatcher[op.GetType().Name];
        stmts.Add(opdis(op)); 
      }
      if (_specialStmts.Count > 0)
      {
        foreach (var item in _specialStmts)
          stmts.Add(item);
      }
      return stmts;
    }

13. Example

View license
private void FixupViewEntitySetDefiningQuery(EntitySet entitySet, MetadataWorkspace metadataWorkspac/n ..... /n //View Source file for more details /n }

14. Example

View license
private IList<EdmSchemaError> DoGenerateStoreMetadata(IEnumerable<EntityStoreSchemaFilterEn/n ..... /n //View Source file for more details /n }