SubSonic Forums
All Your Database Are Belong To Us

Repository Pattern and Inspect() how to get sql executed?

Latest post 03-22-2008 5:56 AM by robsworld2006. 2 replies.
  • 03-21-2008 5:40 AM

    Repository Pattern and Inspect() how to get sql executed?

    Hi there,

     Just wondering when using the Repository pattern how can we inspect the sql that is being executed?

     i.e DB.Save(product) =>> INSERT INTO ......

    Regards Dotnetshadow 

    Filed under: ,
  • 03-21-2008 2:33 PM In reply to

    Re: Repository Pattern and Inspect() how to get sql executed?

    You can do this in a number of ways, but the short answer is that we don't have an Inspect() mechanism yet. If you were to run this query outside of the Factory method (DB.Save()) you could just do a SqlQuery.ToString() and it would return the sql.

    Other than that, SQL Profiler can help as well as setting a break point. 

    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!

  • 03-22-2008 5:56 AM In reply to

    Re: Repository Pattern and Inspect() how to get sql executed?

    Thanks for the reply,

    So with regards to running SqlQuery.ToString() do you mean just Query qry = new Query(Tables.Products); qry.ToString()?

    With the breakpoint method do you mean like debug the Subsonic code so you can drill down to the actualy executing sql?

     

    Regards DotnetShadow

Page 1 of 1 (3 items) | RSS