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 into MiniProfiler #134

Closed
wants to merge 49 commits into from
Closed

Adding support for Entity Framework 6 into MiniProfiler #134

wants to merge 49 commits into from

Conversation

stebet
Copy link
Contributor

@stebet stebet commented Mar 14, 2013

Although EF6 is currently in Alpha 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.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>

B.t.w, I seem to be unable to make the commit history on this pull request cleaner, don't know if I'm doing something wrong (I'm a GitHub noob). The files changed are correct though.

maddyblue and others added 19 commits March 8, 2013 10:07
On my system redis would return ['ABC', 'XYZ'] instead of ['XYZ', 'ABC']
which should still fit the requirement of the failing spec.
RSolr queries are currently only displaying as network requests which is
not very helpful to debug slow search queries. This patch adds profiling
of RSolr request so they are listed like SQL queries with the displayed
data allowing do build up a manual query using eg. curl.

The profiling hook requires at least RSolr 1.0.0 and ensures it is
available to avoid breakage.

Example output facetted search:
```
POST http://localhost:8983/solr/development/select?wt=ruby
fq=type:Spree\:\:Product&fq=is_active_b:true&sort=score desc&q=macbook&fl=* score&qf=name_text brand_text description_text sku_text vendor_sku_text&defType=dismax&start=0&rows=10&facet=true&facet.query=price_f:[0\.0 TO 10\.0]&facet.query=price_f:[10\.0 TO 50\.0]&facet.query=price_f:[50\.0 TO 100\.0]&facet.query=price_f:[100\.0 TO 500\.0]&facet.query=price_f:[500\.0 TO 800\.0]&facet.query=price_f:[800\.0 TO 1000\.0]&facet.query=price_f:[1000\.0 TO *]&f.taxon_ids_im.facet.mincount=1&facet.field=taxon_ids_im
```
Delete index query:
```
POST http://localhost:8983/solr/development/update?wt=ruby&commit=true
<delete><query>type:Spree\:\:Product</query></delete>
```
There were quite some files that mixed tabs and spaces for indenting
which have been fixed to use spaces consistently. I've also removed
redundant whitespace for those files.
Added a new project for Entity Framework 6 - Alpha 3.
No need to enable the package restore for now.
@SamSaffron
Copy link
Owner

this needs rebasing ... very hard to tell what happened

@stebet
Copy link
Contributor Author

stebet commented Mar 26, 2013

I will create a new fork and a new pull request without the noise.

@stebet stebet closed this Mar 26, 2013
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

6 participants