home recent topics recent posts search faq  

Huagati Systems Support Forum



register | lost password   open id sign in with Twitter
Messages in this topic - RSS

Home » Huagati Linq-to-SQL Profiler Support » Using Profiler with DBML tool

Support for the Huagati Query Profiler, Huagati Linq-to-SQL Profiler, Huagati Entity Framework Profiler, Huagati LLBLGen Profiler
8/4/2009 4:39:22 PM

smuskopf
smuskopf
Posts: 4
I use the DBML EDMX tool to generate my DBML (.cs, .designer.cs, etc.) which includes the constructor for my DataContext. I now want to add the Linq-to-SQL profiler. So, I another constructor method in the .designer.cs to pass the enableProfiler flag. I then have to add to my DataContextProxy (.proxy.cs) constructor a call to this new method. Unfortunately, the proxy.cs gets regenerated and loses my changes.

How should I be implementing Profiler along with the DBML tool?
0 permalink
8/4/2009 9:24:41 PM

Kristofer Andersson
Kristofer Andersson
Moderator
Posts: 331
Hi,

Add the new constructor in a partial class in a separate .cs file in the same project (and same namespace as the datacontext), instead of in the generated .designer.cs file.

The generated datacontext and entity classes are all partial classes so you can add additional functionality in separate files as partial classes to avoid having the customizations overwritten whenever the generated code is re-generated.

E.g.:

C#:


VB:


Also see the profiler walkthrough in my blog at:
http://huagati.blogspot.com/2009/06/profiling-linq-to-sql-applications.html

.
edited by Kristofer on 8/4/2009

0 permalink
8/5/2009 10:16:29 AM

smuskopf
smuskopf
Posts: 4
Duh - that worked. Thanks for the quick reply!
0 permalink

Home » Huagati Linq-to-SQL Profiler Support » Using Profiler with DBML tool





Powered by Jitbit Forum 7.1.0.0 © 2006-2011 Jitbit Software