Hi there,
I'm using the final build of 2.6.
I wonder if someone could give me a hand with this. I override CreateConcurrencyPredicateFactory() in my entity to return a custom predicate factory, but when I run my code (and debug it), the CreatePredicate() method in my custom factory never gets called.
To figure out why, I override GetConcurrencyPredicate to see what's happening in there, but that method is never run either. So I suspect I've done something wrong, but I don't know what. Shouldn't GetConcurrencyPredicate get called during the save process?
Here's what I have:
Simple code in a test method:
var md = new LinqMetaData();
var s = md.CreateResource("Study", "Data.EntityClasses.StudyEntity") as StudyEntity;
s.Itn = "boo";
md.SaveChanges();
Code in partial class StudyEntity:
protected override IConcurrencyPredicateFactory CreateConcurrencyPredicateFactory()
{
return new StudyConcurrencyFilterFactory();
}
public override IPredicateExpression GetConcurrencyPredicate(ConcurrencyPredicateType predicateTypeToCreate)
{
return base.GetConcurrencyPredicate(ConcurrencyPredicateType.Save);
}
I put a breakpoint on the return statement in GetConcurrencyPredicate(), but it never goes there.
I'm not putting my factory here as it doesn't seem important because it never gets run. It DOES the picked up by the entity because CreateConcurrencyPredicateFactory() gets run on entity initialization. But that's the extent to its use as far as I can tell.
Thanks for your help,
Philip