Implementing a general ConcurrencyFilterFactory for all entities

Posts   
 
    
noobix
User
Posts: 14
Joined: 06-Nov-2007
# Posted on: 14-Dec-2007 14:30:47   

Hi,

all my DB tables have 2 columns in common: UpdateUserId and UpdateTimeStamp

I want to use these columns to implement a global concurrency filter for all my entities. In the LLBLGen Pro v2.5 documentation I found some sample code showing how to implement the interface IConcurrencyPredicateFactory and its method CreatePredicate(...).

I understand that in the method implementation I have to create a PredicateExpression representing the filter used to save and delete entities.

What I don't know is how to use the fields UpdateUserId and UpdateTimeStamp in a general manner due to these properties are part of my entities but not of the entity base class.

Is there a way to make these fields/properties available in the entity base class (or even inject them to it) thus I can use them to build a PredicateExpression to be used on all save/delete actions for all entities?

I hope you can help me solving that issue.

Best regards, Tino

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 14-Dec-2007 16:14:30   

A user has posted an example in VB right here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=10654 He used a CTor overload to pass in the involved IEntityField.

If you need any help with the example, we'd be happy to help.