I have a controller view which lists recent comments. I also have a textbox and button to add a new comment. When I post to the Save action, I need to validate the textbox. However if the validation fails, when returning to the view, I also need to reload all the comments all over again, which feels like an unnecessary db call.
Example: My Action contains a parameter called comment. If comment if invalid (blank or contains profanity) Create a new ViewModel. Load the previous comments from db. Add comments to ViewModel AddModelError for the comment. Return View(model).
Is there no way of retaining the comments originally loaded, to prevent hitting the db again?