Geeks With Blogs

Scott Kuhl Warning: I may have no idea what I am talking about!

If the querying power of SubSonic falls short for your needs, you can still use the existing functionality and extend it by accessing the commands that are being built before execution.  (These can also be very helpful when debugging.)

The query object has four commands: BuildCommand, BuildDeleteCommand, BuildSelectCommand and BuildUpdate that all return QueryCommand objects, as well as the GetSql method that returns the raw SQL.

string sql = query.GetSql();

Each auto-generated object also has the ability to return a QueryCommand by calling one of four methods: GetInsertCommand, GetSelectCommand, GetUpdateCommand and GetDeleteCommand.

SubSonic.QueryCommand cmd = product.GetInsertCommand(User.Identity.Name);

Find the entire series of posts here.

Posted on Thursday, December 7, 2006 1:26 PM SubSonic | Back to top


Comments on this post: Getting Started with SubSonic - Part 19, Queries - Commands

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Scott Kuhl | Powered by: GeeksWithBlogs.net