asp.net mvc LINQ TO SQL handling database events (alerts/feed)
Recently I did one web site (www.ramtajogi.com) using asp.net mvc, linq t开发者_JAVA技巧o sql . I have used repository pattern to get data from the database. Now everything is working fine. But the new requirement is to record all the events (on poetry book created, on poem added or when a new comment is posted to any poem. What is the best way to implement it. Should I change my existing classes and do or is there any better way to do it.
Regards Parminder
I think what you are looking for is a way to log across different actions:
Try this: http://www.singingeels.com/Articles/Logging_with_ASPNET_MVC_Action_Filters.aspx
Maybe you want to go the "SQL Trigger" road? I know it's a much debated subject, but it allows you to log without changing any of your existing code.
I'm not sure about its impact, but if the triggers only do some inserts into a log table, I guess it should be quite low.
Thanks everyone,
Actually I created another table for alerts and added one record for every event.
Regards Parminder
精彩评论