Profiling LightSwitch using Entity Framework Profiler
This post is to help everyone who want to understand what LightSwitch is going to do under the covers. It allows you to see exactly what is going on with the database interaction using Entity Framework Profiler.
In your LightSwitch application, switch to file view:
In the server project, add a reference to HibernatingRhinos.Profiler.Appender.v4.0, which you can find in the EF Prof download.
Open the ApplicationDataService file inside the UserCode directory:
Add a static constructor with a call to initialize the entity framework profiler:
public partial class ApplicationDataService { static ApplicationDataService() { HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize(); } }
This is it!
You’re now able to work with the Entity Framework Profiler and see what sort of queries are being generated on your behalf.
Comments
Comment preview