linq to sql dynamic data modify object before insert and update

Posted by Dan Tanner on Stack Overflow See other posts from Stack Overflow or by Dan Tanner
Published on 2010-06-18T05:49:49Z Indexed on 2010/06/18 5:53 UTC
Read the original article Hit count: 370

Filed under:
|
|
|

I'm using Dynamic Data and LINQ to SQL for some admin pages on a .NET 3.5 web app. All my admin tables a CreatedBy, CreatedDate, UpdatedBy, and UpdatedDate.

I'm looking for a way to inject the setting of these properties before the objects are inserted and updated.

I've seen an object_inserting hook if you have a linq to sql datasource in the web form, but I'm using dynamic data...is there an easy way to generically set that? And I've also looked at modifying each of the partial classes for my admin objects, but the closest hook I see is to implement the OnValidate method with the Insert action. Any suggestions? TIA.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET