Auditing tables with BigInt PK's (System.Int64) throws exception


When these tables are set up through:

When trying to insert/update the table I get the following exception:
Expression of type 'System.Int64' cannot be used for return type 'System.Int32'
[ArgumentException: Expression of type 'System.Int64' cannot be used for return type 'System.Int32']
System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection1 parameters) +760272
System.Linq.Expressions.Expression.Lambda(Expression body, IEnumerable
1 parameters) +72
System.Linq.Expressions.Expression.Lambda(Expression body, ParameterExpression[] parameters) +71
Doddle.Linq.Audit.AuditExtensions.GetEntityPropertySelector(IAuditableContext context, String propertyName) in D:\Development\Projects\CodePlex\Doddle.Linq.Audit\Doddle.Linq.Audit\AuditExtensions.cs:93
Doddle.Linq.Audit.AuditExtensions.GetEntityPkSelector(IAuditableContext context) in D:\Development\Projects\CodePlex\Doddle.Linq.Audit\Doddle.Linq.Audit\AuditExtensions.cs:84
Doddle.Linq.Audit.AuditExtensions.Audit(Table`1 table) in D:\Development\Projects\CodePlex\Doddle.Linq.Audit\Doddle.Linq.Audit\AuditExtensions.cs:56

Do You have any suggestions for a workaround without changing the source code of doodleaudit?

Best Regards


mhidinger wrote Dec 16, 2009 at 3:13 PM

Hi Alex,

Thanks for reporting this issue and your patience awaiting a fix. I am working on the next release which will fix this issue. It should be ready within a week or so.


mhidinger wrote Dec 16, 2009 at 3:14 PM

Apologies, should say Alek above :)

BockSoft wrote Feb 6, 2012 at 1:37 PM


Same goes for Guid as primary key, also made a issue for this.
  • Julian