I am getting the following error when I try to update a record when the records timestamp has changed:
An exception was caught during the execution of an action query: Object must implement IConvertible.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
Here is my implementation of IConcurrencyPredicateFactory:
public class ConcurrencyPredicateFactory : IConcurrencyPredicateFactory
{
public ConcurrencyPredicateFactory() {}
public IPredicateExpression CreatePredicate(ConcurrencyPredicateType typeToCreate, object containingEntity)
{
IPredicateExpression concurrancyPredicate = new PredicateExpression();
IEntity2 entity = (IEntity2)containingEntity;
if(entity.Fields["RowVersion"] != null && typeToCreate == ConcurrencyPredicateType.Save)
{
EntityField2 rowVersionField =
new EntityField2("RowVersion", entity.LLBLGenProEntityName, typeof(System.Byte[]),
TypeDefaultValue.GetDefaultValue(typeof(System.Byte[])), false,
(int)entity.Fields["RowVersion"].FieldIndex, 8, 0, 0, false);
FieldCompareValuePredicate compairRowVersion =
new FieldCompareValuePredicate((IEntityFieldCore)rowVersionField, null, ComparisonOperator.Equal,
entity.Fields["RowVersion"]);
concurrancyPredicate.Add(compairRowVersion);
}
return concurrancyPredicate;
}
}
I am expecting to get an error but the error I am expecting is the RMConcurrencyException not the ORMQueryExecutionException.
Can anyone see whats wrong here???