modified DQE/ORMSupport

Posts   
 
    
twisty7867
User
Posts: 6
Joined: 08-Feb-2007
# Posted on: 12-Feb-2007 17:53:16   

Hi,

I am new to LLBLGen and working to transition from some LLBLGen 1.0/.NET 1.1 code to new 2.0/2.0 code. Right now we have a custom SqlServerDQE project to implement a few features, but I'm wondering if that is the "right" way to go about it.

The customizations do the following:

Code in CreateInsertDQ() keeps an eye out for any of our "special" field names and populates them with some appropriate data.

Code in CreateSelectDQ() appends "WHERE Status > 0" to every WHERE clause to ensure that logically deleted records are not returned.

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 13-Feb-2007 08:33:45   

but I'm wondering if that is the "right" way to go about it. The customizations do the following:

Code in CreateInsertDQ() keeps an eye out for any of our "special" field names and populates them with some appropriate data.

Code in CreateSelectDQ() appends "WHERE Status > 0" to every WHERE clause to ensure that logically deleted records are not returned.

There is no right and wrong in code implementations, especially if you have many options that work.

So as long as your code is working it's ok.

And since you want to implement these additions upon all the entities (Insert and Select). Then I see no problem in your solution.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39927
Joined: 17-Aug-2003
# Posted on: 13-Feb-2007 10:04:10   

twisty7867 wrote:

Hi,

I am new to LLBLGen and working to transition from some LLBLGen 1.0/.NET 1.1 code to new 2.0/2.0 code. Right now we have a custom SqlServerDQE project to implement a few features, but I'm wondering if that is the "right" way to go about it.

As Walaa said, if the code works for you, why change. However you could refactor these out to code outside the DQE. It would be good to know what you're using: selfservicing or adapter.

The customizations do the following:

Code in CreateInsertDQ() keeps an eye out for any of our "special" field names and populates them with some appropriate data.

You could do this in the initialize events of an entity, or in a validator. Or if you're using adapter for example, you can add this code for all entities in an override of OnBeforeEntitySave in a derived class of the DataAccessAdapter class.

Code in CreateSelectDQ() appends "WHERE Status > 0" to every WHERE clause to ensure that logically deleted records are not returned.

Similar.

Frans Bouma | Lead developer LLBLGen Pro