Search code examples
c#asp.netloggingdynamic-data

Adding logging to an asp.net Dynamic Data application


I am trying to find out what would be the best way to add logging to a Dynamic Data app? I am using DD for an admin interface and I need to log all the actions the user makes. I thought of adding things to the codebehind of the PageTemplates\ListDetails for example, but was wondering if there is a better way... For data access I am using Entity Framework with Sqlite.

Any help is very much appreciated!


Solution

  • If you want your user info added to the audit trail you could do one of two things:

    1. Use SPROCS in your DB to do CRUD operations and passin the user info
    2. Add business logic in the form of Partial Classes to your model

    See links: How to: Execute Business Logic When Saving Changes (Entity Framework) How to Map Stored Procedures using the ADO.NET Entity Framework