none
Entity Framework 4.1 Sql Logging RRS feed

  • Question

  • One missing feature in the new DbContext is a simple way to trace all SQL generated from the context.  It would be great if there was a simple method to provide a delegate that will be called with the generated sql.  While the new API is much cleaner and better than the ObjectContext it wraps, having such a method out of the box would be great.  I know there is a EF Trace Provider wrapper but this does not work without modification with the DbContext.  I also know you can cast an linq query and get the sql, but having one place to provide a hook-in to be called with the SQL would be great!  Given that Entity Framework generates the SQL I think this should be provided an easy way to log it.  I would really like to see this added as a feature in the very near future.
    Tuesday, October 4, 2011 5:41 PM

Answers

  • Thank you very much for your feedback. I will forward this to the product team.

    You can also use the following website. It allows you to more easily submit and vote on feature requests for EF, without the overhead of Connect.

     http://data.uservoice.com/forums/72025-ado-net-entity-framework-ef-feature-suggestions

     

    thank you,

    Julia


    This posting is provided "AS IS" with no warranties, and confers no rights.
    Wednesday, October 5, 2011 6:14 AM
    Moderator