Wednesday November 25th

How to use custom audit fields with SubSonic

SubSonic uses a few audit fields by default - you don’t need to write any code. However, the field names that are used are coded into the source code. You can modify the source code and generate a new assembly, but if you’re like me and would rather not edit the source code (so you don’t need to update the code at every release), then you’ll be looking for an alternative approach. Three options are discussed: 1) Modify SubSonic source code, 2) Use partial classes for each table, 3) Create a custom template and base class


Nice article. A great example how the "convention"-based-approach of subsonic gives basic problems :-(

I used/use subsonic in many projects, but lately i have been looking more at other directions. I just dont get that "happy"-feeling using it anymore - too many bugs gave me headaces :-(

I submitted a patch that allowed you to add AuditFieldProviders via config which would allow you to configure whichever audit fields globally or per table (and it was tied into all query etc. code by overriding a few virtual methods on the base provider).

Don't even think it was looked at by the devs; i've found time and again that open source projects ran by one or two people rarely take patches from outside- anything major they'll want to do, and anything they don't personally find useful is ignored.

I'd go for option 4, dump subsonic and use entity framework.

Commenting on Stories is limited for now and will open up to those recommended by the community. Learn how
Loading DotNetKicks...
brought to you by the Kicks Network