c# - MVC: Which method should be overridden to cache action result -


I am preparing for the Microsoft Certificate Exam (70-515), reading the Microsoft Book for this exam, Practice ... asks a test:

You are creating custom MVC action filters for cash action results.

Which virtual method should you override?

The correct answer (according to the testing program, which has been distributed with a book) is to "make all the internals"

and clarification for the answer:

When you create a custom action filter while inheriting from the ActionFilterAttribute class, you can override the four virtual methods that run in the following order: OnActionExecuting (), OnActionExecuted (), Internal Equate ), And HonorseltAccounted () of output caching For, you want to get the last rendered result. Therefore, you should override the last method to run: OnResultExecuting ().

There is an inconsistency: if we need to override the last mentioned method, then it must be "personal-specific".

  1. What is the correct way to override?
  2. Which option should I choose in the test to give the right answer? (In case of the question, the "right" answer is actually different from the suggestions suggested by the system.

    Thanks.

    PS I'm not sure The current question is SO, but at least it is quite close

    After some time it's something Got it: If you have already removed the cached, to check that you have already removed the cached, but to check 'on If you will get it from the cache, if not, then you will actually perform the functionality of the "execution" part and then put it in the cache.

Comments