How to use custom audit fields with SubSonic(jamesewelch.com)

submitted by jamesewelchjamesewelch(2275) 3 years, 8 months ago

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

2 comments |category: |Views: 215

tags: another

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:
Comments:

posted by duckieduckie(150) 3 years, 7 months ago 0

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 :-(

Reply

posted by lor3lor3(0) 3 years, 7 months ago 0

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.

Reply

information Login or create an account to comment on this story