Skip to content

Commit

Permalink
Port Readme changes (#2256)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndriySvyryd authored Jun 11, 2024
2 parents 7e1ad84 + 4f0cec0 commit 20c5685
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 15 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Entity Framework 6

Entity Framework 6 (EF6) is an object-relational mapper that enables .NET Framework, .NET Core, and modern .NET developers to work with relational data using domain-specific objects. It eliminates the need for most of the data-access code that developers usually need to write.
Entity Framework 6 (EF6) is a tried and tested object-relational mapper for .NET with many years of feature development and stabilization. It eliminates the need for most of the data-access code that developers usually need to write.

## Status and Support

Expand All @@ -17,12 +17,6 @@ This plan focuses on stability of the codebase and compatibility of new versions

Entity Framework Core (EF Core) is a lightweight and extensible version of Entity Framework and continues to be actively developed on [the EFCore GitHub repo](https://github.com/dotnet/efcore). EF Core is developed exclusively for modern .NET and does not run on .NET Framework. EF Core includes [many improvements and new features over EF6](https://docs.microsoft.com/ef/efcore-and-ef6/). EF Core has a different architecture to EF6 and takes a very different approach to its internals--for example, EF Core does not support a visual designer or EDMX files. However, most EF6 projects can be ported to EF Core with some amount of work--see [Port from EF6 to EF Core](https://docs.microsoft.com/ef/efcore-and-ef6/porting/) for a guide.

## Forks

The EF6 code is published under the [MIT](https://github.com/dotnet/ef6/blob/main/LICENSE.txt). This means it is permissible to [fork the code](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) and build custom versions of EF6. Making changes in a fork is one way to work around any issues or add new features without impacting the stability of the main branch and releases. Indeed, there are commercial third-party forks of EF6 available for a fee that add new features to EF6. (Microsoft does not endorse or provide support for any forked versions of EF6.)

Note that a fork is not needed to use EF6 on .NET Core and modern .NET platforms; the existing EF6 packages already support this.

## Getting help

See [the EF6 docs](https://docs.microsoft.com/ef/ef6/) for installation, documentation, tutorials, samples, etc. This documentation is no longer being updated, but still contains useful and usable content.
Expand Down
10 changes: 6 additions & 4 deletions src/EntityFramework.NuGet/EntityFramework.NuGet.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<metadata>
$CommonMetadataElements$
<language>$NeutralLanguage$</language>
<readme>README.md</readme>
<frameworkAssemblies>
<frameworkAssembly assemblyName="System.ComponentModel.DataAnnotations" targetFramework=".NETFramework4.0, .NETFramework4.5" />
</frameworkAssemblies>
Expand Down Expand Up @@ -50,9 +51,10 @@
<file src="../../artifacts/bin/EntityFramework.SqlServer/$Configuration$/netstandard2.1/EntityFramework.SqlServer.dll" target="lib/netstandard2.1/" />
<file src="../../artifacts/bin/EntityFramework.SqlServer/$Configuration$/netstandard2.1/EntityFramework.SqlServer.xml" target="lib/netstandard2.1/" />
<file src="../../artifacts/bin/Microsoft.Data.Entity.Build.Tasks/$Configuration$/netstandard2.0/Microsoft.Data.Entity.Build.Tasks.dll" target="build/" />
<file src="build\**\*" target="build/" />
<file src="buildTransitive\**\*" target="buildTransitive/" />
<file src="content\**\*" target="content/" />
<file src="tools\**\*" target="tools/" />
<file src="build/**/*" target="build/" />
<file src="buildTransitive/**/*" target="buildTransitive/" />
<file src="content/**/*" target="content/" />
<file src="tools/**/*" target="tools/" />
<file src="../../README.md" target="/" />
</files>
</package>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<metadata>
$CommonMetadataElements$
<language>$NeutralLanguage$</language>
<readme>readme.md</readme>
<dependencies>
<group targetFramework=".NETFramework4.0">
<dependency id="EntityFramework" version="$Version$" exclude="Build,Analyzers" />
Expand All @@ -21,5 +22,6 @@
<file src="../../artifacts/bin/EntityFramework.SqlServerCompact/$Configuration$/net45/EntityFramework.SqlServerCompact.dll" target="lib/net45/" />
<file src="../../artifacts/bin/EntityFramework.SqlServerCompact/$Configuration$/net45/EntityFramework.SqlServerCompact.xml" target="lib/net45/" />
<file src="content\**\*" target="content/" />
<file src="readme.md" target="/" />
</files>
</package>
1 change: 1 addition & 0 deletions src/EntityFramework.SqlServerCompact/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allows SQL Server Compact 4.0 to be used with Entity Framework.
28 changes: 24 additions & 4 deletions src/Microsoft.EntityFramework.SqlServer/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This provider depends on the modern [Microsoft.Data.SqlClient](https://github.co
- Supports most Azure Active Directory authentication methods
- Supports Always Encrypted with .NET

Notice that this provider is a runtime only update, and will not work with the existing Visual Studio tooling.
Notice that this provider is a runtime only update and will not work with the existing Visual Studio tooling.

The latest build of this package is available from [NuGet](https://www.nuget.org/packages/Microsoft.EntityFramework.SqlServer)

Expand All @@ -36,7 +36,7 @@ Or you can use the SetConfiguration method before any data access calls:
````csharp
DbConfiguration.SetConfiguration(new MicrosoftSqlDbConfiguration());
````
Or you can add the following lines to your existing DbConfiguration class:
Or add the following lines to your existing derived DbConfiguration class:
````csharp
SetProviderFactory(MicrosoftSqlProviderServices.ProviderInvariantName, Microsoft.Data.SqlClient.SqlClientFactory.Instance);
SetProviderServices(MicrosoftSqlProviderServices.ProviderInvariantName, MicrosoftSqlProviderServices.Instance);
Expand Down Expand Up @@ -97,7 +97,7 @@ Also update the provider name inside the EntityConnection connection string - `p

## Code changes

In order to use the provider in an existing solution, a few code changes are required (as needed).
To use the provider in an existing solution, a few code changes are required (as needed).

`using System.Data.SqlClient;` => `using Microsoft.Data.SqlClient;`

Expand All @@ -121,6 +121,26 @@ The following classes have been renamed to avoid conflicts with classes that use

## Known issues

**Azure App Service with .NET Framework and connection strings configuration**

If you use Azure App Service with .NET Framework and the [connection strings configuration feature](https://learn.microsoft.com/azure/app-service/configure-common?tabs=portal#configure-connection-strings), you can encounter runtime issues, as the `ProviderName` connection string setting in this scenario is hardcoded to `System.Data.SqlClient`.

Solution is to use a derived MicrosoftSqlDbConfiguration class like this:

```csharp
public class AppServiceConfiguration : MicrosoftSqlDbConfiguration
{
public AppServiceConfiguration()
{
SetProviderFactory("System.Data.SqlClient", Microsoft.Data.SqlClient.SqlClientFactory.Instance);
SetProviderServices("System.Data.SqlClient", MicrosoftSqlProviderServices.Instance);
SetExecutionStrategy("System.Data.SqlClient", () => new MicrosoftSqlAzureExecutionStrategy());
}
}
```

Then use this derived class in the code-based configuration described above.

**EntityFramework.dll installed in GAC**

If an older version of EntityFramework.dll is installed in the .NET Framework GAC (Global Assembly Cache), you might get this error:
Expand All @@ -131,6 +151,6 @@ Solution is to remove the .dll from the GAC. EF6 assemblies should never be inst

## Release notes

### 6.5.0-preview.1
### 6.5.0-preview2

- Initial preview

0 comments on commit 20c5685

Please sign in to comment.