Click here to Skip to main content
15,886,422 members
Articles / Database Development / SQL Server

Profiling Entity Framework 5 in code

Rate me:
Please Sign up or sign in to vote.
4.83/5 (9 votes)
27 Nov 2012CPOL4 min read 56.4K   693   39  
Hook SaveChanges and see exactly what T-SQL is hitting your database without attaching a profiler
using System.Data.Entity;

namespace EntityFramework.Hooking
{
    public static class Extensions
    {
        public static void HookSaveChanges(this DbContext dbContext, EntityFrameworkHook.SaveChangesHookHandler funcDelegate)
        {
            new EntityFrameworkHook(dbContext,funcDelegate);
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Daisy Solutions Ltd
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions