3.5.1 Question
Multiple Choice
Your application manages the sale of expensive well-drilling equipment. Your IT director wants you to add functionality that sends an email to a customer’s sales account manager whenever someone from your client company logs in to the system. What is an appropriate solution?
- A. Override the AuthorizeAttribute and apply it to the login action. Run the base method first to handle the authentication and then evaluate the status of the request. If the user is a customer, send the email.
- B. Create a custom action filter that is globally defined and overrides the OnActionExecuting method. This action filter evaluates the status of the user and sends the email if it is a customer.
- C. Override the AuthorizeAttribute that is applied to the login action, check for the user’s authentication status, and determine whether it is a customer prior to sending it to the base authentication method.
- D. Create an action filter that overrides the OnActionExecuted method and apply it to the login action. This action filter evaluates the status of the user and sends the email if it is a customer.