Using Linq to SQL change events with attribute-based mapping

Posted by R Mene on Stack Overflow See other posts from Stack Overflow or by R Mene
Published on 2010-04-24T22:23:20Z Indexed on 2010/04/24 22:33 UTC
Read the original article Hit count: 198

I'm writing a new ASP.NET MVC2 application using Linq to SQL. This application depends on an existing SQL database.

I am using attribute-based mapping to map my database fields to my Linq to SQL entities. I also need to make use of Linq to SQL's On[Property]Changed methods so I can perform change-auditing of database tables within my application.

Whereas the documentation explains how to do this when using Linq to SQL's ORM and dbml files (i.e. by writing partial classes), it is not clear how to do with when using attribute-based mapping or when using XML-based mapping.

It would be very helpful if someone could describe how to do this.

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about asp.net-mvc-2