-
Notifications
You must be signed in to change notification settings - Fork 545
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't call Add-EFProvider or Add-EFDefaultConnectionFactory #953
Conversation
Should we remove Add-EFProvider? (We still need Add-EFDefaultConnectionFactory to dynamically choose between SQL Express and LocalDB) The only providers that I can see using it are Firebird, Npgsql, and SQLite. They could update to this pattern. |
What is the experience if you install one of these existing providers on top of the EF 6.3 package and those scripts are missing? Is our own old SQLCE provider using it? |
Ah, I asked this before I looked at the changes 😄
Is there a way to use these transforms so that on package upgrade we don't touch the defaultConnectionFactory if there is one there? Or does the uninstall transform always need to run followed by the install transform on package upgrade? Asking because I think ideally we would stop using Add-EFDefaultConnectionFactory. |
I realized we can internalize the logic for Add-EFDefaultConnectionFactory and remove it too. |
All of this only works with packages.config so PackageReference is unaffected. We could make them warn and no-op, but I’m not sure you can even get into that situation. There would have to be an update to the provider package that still used the cmdlets. |
Or you’d have to install the EF 6.3 package then an older provider. Don’t we tell customers to just install the provider package? |
Yeah, I was reading about that just now. Thanks for explaining.
Ok, I might be missing it completely, but what I had in mind, is to install EF 6.3 and the install a provider that hasn't been updated and still relies on the cmdlets (but that it is otherwise compatible with EF 6.3 because we are not making breaking changes).
Crazy idea (sorry for the randomization if it is too crazy): what if EF 6.3 didn't do any transform on install (even for package.config) but also didn't do any transform on uninstall? I am speculating that this would result in:
Are we at a point in which the runtime (and providers) can choose reasonable defaults when there is zero configuration? A couple of pieces I imagine could be missing are:
|
I guess yes, but it is reasonable to do the above if you want some new feature from EF 6.3 but the provider hasn't been updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but:
- I would love a conversation about alternatives, e.g. like the ideas I wrote below to stop doing this altogether and have the runtime work without any configuration (for any provider)
- I actually missed why we are switching to the transformation files given that it only works for package.config anyway. I am sure there is a reason, just don't know what it is.
26aaec6
to
8d16783
Compare
(Updated to revert uninstall behavior changes) |
This PR was mostly to prove that providers can preserve existing behavior without Add-EFProvider and Add-EFDefaultConnectionFactory. I'd prefer to remove them rather than port them to the new architecture. |
I know we tried transforms for this a long time ago and the experience wasn't great, but I don't remember the details. However, I think it's probably good enough anyway. I'm going to approve this, but we can still discuss other options. |
Discussed with @divega, and we're going to keep Add-EFProvider & Add-EFDefaultConnectionFactory |
@ajcvickers This is using the "new" (since obsoleted by PackageReference) XDT transforms which are more powerful than |
TL;DR for @cincuranet, @roji & @mistachkin: The pattern of calling |
@bricelam any tips on how to get those four files into the nupkg correctly from a project that only has a csproj (am tired from fighting with nuget)? <ItemGroup>
<Content Include="content/**" PackagePath="contentFiles/any">
<IncludeInPackage>true</IncludeInPackage>
</Content>
</ItemGroup> This gets the files in the nupkg, but in the nuspec they're listed under Thanks... |
@roji They need to go under |
@roji Any reason you included also the |
@cincuranet I honestly don't remember any more... I think maybe I just followed the example from EF6? |
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
@cincuranet Issue #920 will help with the ADO.NET part of things. Does anyone actually use the default connection factory? I imagine most people use a provider-specific connection object or a connection string from config that also specifies the provider. |
Never seen the default connection factory to be used in real code. |
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* DNET-883 * dotnet/ef6#953
* Take dependency on EF6 6.3.0 GA * Take dependency on Npgsql 4.0.10. Also tested successfully with 4.1.1, but not taking dependency in order to preserve compatibility with .NET Framework 4.5. * Package snupkg * Nuget icon * Use transforms instead of Add-EFProvider (in install.ps1). See dotnet/ef6#953 * Various build cleanups, project renames, etc. Closes #137
Part of #231