Quantcast
Channel: Entity Framework
Viewing all articles
Browse latest Browse all 10318

Created Issue: SqlServerMigrationSqlGenerator.CreateConnection does not allow wrapping providers [775]

$
0
0
We got this bug report from Fitzchack Yitzchaki of Hibernating Rhinos:

public class SqlServerMigrationSqlGenerator : MigrationSqlGenerator
{
protected virtual DbConnection CreateConnection()
{
return new SqlConnection();
}


Instead of hard codding the connection, we expecting it to use:


public class ProfiledMigrationSqlGenerator : SqlServerMigrationSqlGenerator
{
protected override DbConnection CreateConnection()
{
return DbProviderFactories.GetFactory("System.Data.SqlClient").CreateConnection();
}
So we can actually turn it to ProfiledConnection. This is how you did this in SqlCeMigrationSqlGenerator:


public class SqlCeMigrationSqlGenerator : SqlServerMigrationSqlGenerator { /// <inheritdoc /> protected override DbConnection CreateConnection() { return DbProviderFactories.GetFactory("System.Data.SqlServerCe.4.0").CreateConnection(); }

Viewing all articles
Browse latest Browse all 10318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>