This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, is there any way to retrieve the SQL query string that is about to be executed on UnitOfWork's SaveChanges()? Thanks! |
|
|
No, you cannot capture the actual SQL query before it is executed but you can inspect this using the debugger visualizer and you can log the SQL query by attaching a Logger class to your LightSpeedContext owning the UnitOfWork you are using - see http://www.mindscapehq.com/documentation/lightspeed/Testing-and-Debugging/Logging for more details on this.
|
|
|
What are you trying to do with the query? You could write a class that inherits from Mindscape.LightSpeed.Profiling.Interceptor, then when you create the LightSpeedContext, set the context.Interceptor property to an instance of the custom Interceptor class. In the custom class you can override ExecuteCommand, which will give you access to the IDbCommand before it is executed. The product is amazingly extensible. Hope that helps, Jason |
|