Using Linq to SQL change events with attribute-based mapping
- by R Mene
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.