I am having all sorts of problems to get any sort of concurrency testing to work
I know that I should be setting the ConcurrencyProdicateFactoryToUse but I cannot get it to work
I can get something to compile but when it runs I get a casting error (using 1.0.2005) :-
System.Web.Services.Protocols.SoapException was unhandled
Message=System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidCastException: Unable to cast object of type 'SD.LLBLGen.Pro.ORMSupportClasses.PredicateExpression' to type 'SD.LLBLGen.Pro.ORMSupportClasses.IConcurrencyPredicateFactory'.
I have ripped a piece of code from the forum to create my factory :-
public IPredicateExpression CreatePredicate (ConcurrencyPredicateType typeToCreate, object containingEntity)
{
IPredicateExpression concurrencyPredicate = new PredicateExpression();
IEntity2 entity = (IEntity2)containingEntity;
if (entity.Fields["RowVersion"] != null && typeToCreate == ConcurrencyPredicateType.Save)
{
concurrencyPredicate.Add(
new FieldCompareValuePredicate(entity.Fields["RowVersion"], null, ComparisonOperator.Equal));
}
return concurrencyPredicate;
}
I am in danger of dissapearing up my own backside at this rate ...
All I want to do is use a field by the name of ADD_Concurrency (in my Address class and also in an AddressEntity as generated by LLB) to be compared to the one currently in the database at the time I am doing an update
All of this is being performed statelessly, so the ADD_Concurrency field is being passed to the client at the time of the read and then passed back to the server at the time of the update. When I perform the update, I need to compare the current value with the one that was read earlier.
Any help gratefully received
Thanks
BOb