开发者

Foreign key problem with Doddle Audit

I've just started playing with Matt Hidinger's great looking Doddle Audit, which provides DataContext located automatic auditing of any changes to LINQ to SQL entities. It works great for single entities, but also has a feature for associations, e.g. where Order and Order Items are related, changes to an Order Item reflect under changes to the Order.

He gives several examples on how to audit related tables, but none work for me. I have asked in the forum there, but am hoping someone here may have used the project and have some advice for me. If I try and audit a 'parent-child' relationship, e.g.

Orders.Audit().AuditAssociation(o => o.OrderItems);

On any tables, I always get the error:

Expression of type 'System.Int32' cannot be used for return type 'System.Nullable`1[System.Int32]'

I am new to LIN开发者_运维技巧Q to SQL, and suspect something may be wrong there. I simply created and related the tables in SSMS, and dragged them onto the DBML designer.


This is a problem with the pre-compiled 'official' release, and can be fixe by downloading and building the source yourself. Some minor code changes (mostly field renames) will be required to be compatible with the latest source version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜