I wanted to get some basic .NET MVC understanding so I started working on a very simple application that is somewhat similar to Yelp. It consists of a User
object and Business
object. A user can add businesses to their "watch list" and when someone creates a review for that business the application would look through a table of "user id-business id" relations and email the users that are watching that business for new reviews (so that they can respond to them).
In my ReviewsController
, I have a Create
action that creates a review. Before that action returns, I would like to run a method that checks if there are any watches for the business the review was just created for.
This is where I get stuck because I'm not sure what would be a good way of doing this in MVC setting(?).
What I do know is that the user who is creating the review does not need to wait for the application to look through the "user-business" relation table.
Would it be a good idea to create this lookup functionality as an async method? I also looked into events but seems like events are not ideal in MVC setting. Are there any well-established patters in MVC world for situations like these?