Skip to content
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

Adding support for Entity Framework 6 (Currently at Beta 1). #142

Merged
merged 2 commits into from
Jul 3, 2013
Merged

Adding support for Entity Framework 6 (Currently at Beta 1). #142

merged 2 commits into from
Jul 3, 2013

Conversation

stebet
Copy link
Contributor

@stebet stebet commented Mar 26, 2013

Although EF6 is currently in Beta stage, they have made significant changes to bot the underlying injection points as well as the namespaces, requiring a new project (targeting .NET 4.5) to add support.

This pull request adds that project, as well as the needed implementation to inject MiniProfiler into both DbContext and ObjectContext classes. (SqlServer only for now, will probably add SqlCe support also, other providers will hopefully come later as EF6 reaches beta and later RTM).

All that is needed is instead of the old way of calling MiniProfilerEF.Initialize() or using the ObjectContextUtils.CreateObjectContext(conn); you now just need to add the following in the web/app.config:

<configSections>
  <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
  <providers>
    <provider invariantName="System.Data.SqlClient" type="StackExchange.Profiling.Data.EFProfiledSqlClientDbProviderServices, MiniProfiler.EntityFramework6" />
  </providers>
</entityFramework>

Adding support for Entity Framework 6 (currently at Alpha 3).
It is now much easier to add profiling support to the entity framework
simply by the appropriate providers either through configuration or in
code.
Updating the references to target Entity Framework 6 - Beta 1.
dixon added a commit that referenced this pull request Jul 3, 2013
Adding support for Entity Framework 6 (Currently at Beta 1).
@dixon dixon merged commit 107272a into SamSaffron:master Jul 3, 2013
@flipchart
Copy link

Thanks very much for adding this! It finally gives EF 6 support which I have been dying to have.

Any chance this will be wrapped up in a nuget package?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants