PrepAway - Latest Free Exam Questions & Answers

Which interface should you implement?

You are developing an ASP.NET MVC application. The application uses a set of custom exceptions to log
errors that occur during the execution of an action.
You need to develop a class that implements logging.
Which interface should you implement?

PrepAway - Latest Free Exam Questions & Answers

A.
IExceptionFilter

B.
IActionFilter

C.
IClientValidatable

D.
IResultFilter

Explanation:
Exception filters are used to apply global policies to unhandled exceptions in the MVC app.
Exception Filters implement either the IExceptionFilter or IAsyncExceptionFilter interface.
Exception filters handle unhandled exceptions, including those that occur during controller creation and model
binding. They are only called when an exception occurs in the pipeline.


Leave a Reply