mishrsud / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Compatibility problem with Linq-To-Sql compiled queries #125

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use Mvc-Mini-Profiler with a **compiled** Linq-to-Sql Query
2. Linq-To-Sql will complain because it cannot cast the ProfiledDbConnection to 
SqlConnection

Each of the following should implement the interface (not the base type):
ProfiledDbCommand -> IDbCommand
ProfiledDbConnection -> IDbConnection
ProfiledDbDataReader -> IDbReader
ProfiledDbTransaction -> IDbTransaction

That way, I can pass in a SqlConnection into ProfiledDbConnection, it can proxy 
all commands using the interfaces and when Linq-To-Sql tries to access the 
underlying connection of the DataContext, it has the correct SqlConnection (not 
a base type)

Original issue reported on code.google.com by anton.vi...@gmail.com on 25 Nov 2011 at 8:17

GoogleCodeExporter commented 8 years ago
ummm ... we use compiled queries and it works just fine, 

 public abstract class DbConnection : Component, IDbConnection, IDisposable

no repro here, please post a separate question on it 

Original comment by sam.saff...@gmail.com on 13 Feb 2012 at 5:35

GoogleCodeExporter commented 8 years ago

Original comment by sam.saff...@gmail.com on 13 Feb 2012 at 5:35