sqlcsla

SQL generated by CSLA


it's possible to overview SQL generated by EF or Linq2SQL etc. There are few techniques for this purpose. But is it possible somehow to do the same for CSLA? The project's development becomes slower in compare with other technologies (EF/Linq/etc) without ability to review generated SQL


Solution

  • #cslanet doesn't generate any SQL, that is entirely up to you and how you invoke your data access layer. Any techniques you use to view the SQL generated by EF will work, CSLA doesn't change how EF works in any way.

    It is possible that you aren't efficiently or correctly using the CSLA data portal. For example, when loading a collection of objects, you should issue one data query at the collection (or higher parent) level, and then load each child object using the data from that single query.

    I've seen where people issue a SQL query for each child object, which is terribly slow and is a very bad idea. I discuss this in the Using CSLA: Data Access book, including why you need to try to minimize calls to the database.