Linq to Sql - Partial Insert/Update Queries for *All* Tables -
i have database twenty-something tables in it. of them have 4 columns used auditing: createdate, createdby, updatedate, , updatedby.
at moment, using partials each table's insert , update methods, , executing dynamic query, so:
partial void insertstuff(stuff instance) { instance.createdate = datetime.utcnow; instance.createdby = "web app"; this.executedynamicinsert(instance); }
that job; problem have create partial method every table, manually. is there way partial/override all insert , update operations in given context? add nice bit of brevity.
scoured interwebs looking way this, never found 1 (at least, without doing crazy code generation that's not worth effort). i'm switching entity framework in future projects, i'll mark answer.
unless else comes something, of course.
Comments
Post a Comment