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

Edited Issue: Consider removing DbProviderNameAttribute [1281]

$
0
0
We created DbProviderNameAttribute mainly to make it unnecessary to specify the provider invariant name in places in which a provider specific service was required. In particular we thought it would make the API for registering the SqlAzureExecutionStrategy more DRY:

```
AddExecutionStrategy("System.Data.SqlClient", () => new SqlAzureExecutionStrategy())

```
vs.

```
AddExecutionStrategy(() => new SqlAzureExecutionStrategy())
```

However, new changes in other registration APIs are not honoring the attribute, e.g. the fix for [issue #1000](https://entityframework.codeplex.com/workitem/1000), to make it possible to register provider specific migration history factories doesn't use it, and it is relatively hard to change the design to use the attribute since the other input for AddHistoryContextFactory is a delegate type, HistoryContextFactory.

On the other hand, in other places where we use DbProviderNameAttribute it is not adding a lot of value, e.g. for spatial services and provider services, are all auto-registered and the user doesn't need to register a service for them manually.

I believe if we add the ability to have execution strategies alternatively suspended or enabled ([issue #1255](https://entityframework.codeplex.com/workitem/1255)) we could then have SqlAzureExecutionStrategy auto-registered but disabled by default for SQL Server and we would make it less necessary to ever call AddExecutionStrategy().



Viewing all articles
Browse latest Browse all 10318

Trending Articles



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