Hi
I'm not sure if I'm missing something here. I have created a partial class for my entity, added the IConcurrencyPredicateFactory interface to the class declaration, and implemented the CreatePredicate() method.
The documentation seems to indicate that the LLBL framework will detect that the interface has been implemented and call the method. However it doesn't seem to be getting called when I save (update) the entity. Am I missing something - should I be implementing or overriding something else? This is my partial class:
public partial class DocumentEntity : IConcurrencyPredicateFactory
{
public IPredicateExpression CreatePredicate(
ConcurrencyPredicateType predicateTypeToCreate,
object containingEntity)
{
IPredicateExpression expression = new PredicateExpression();
DocumentEntity document = (DocumentEntity)containingEntity;
switch (predicateTypeToCreate)
{
case ConcurrencyPredicateType.Save:
expression.Add(DocumentFields.Timestamp == document.Fields[(int)DocumentFieldIndex.Timestamp].DbValue);
break;
}
return expression;
}
}
It seems to work if I add this to my partial class, but it seems a bit unnecessary:
public override IPredicateExpression GetConcurrencyPredicate(ConcurrencyPredicateType predicateTypeToCreate)
{
return CreatePredicate(predicateTypeToCreate, this);
}
Thanks in advance
Andy