DRAG DROP
You are developing an ASP.NET Web API for a home inventory management system.
You need to limit access to users with IP addresses based only in the United States.
You have the following code:
Which code segments should you include in Target 1 and Target 2 to complete the code? (To answer, drag the
appropriate code segments to the correct targets in the answer area. Each code segment may be used once,
more than once, or nor at all. You may need to drag the split bar between panes or scroll to view content.)
Select and Place:
The correct answer for Target 2: “AuthorizationContext”.
Web API -> HttpActionContext
MVC -> AutorizationContext
I agree, which means “HttpActionContext” is correct in this case.
I agree too
Web API -> HttpActionContext
MVC -> AutorizationContext
As we are considering a web api, the correct solution for Target 1 is AuthorizationFilterAttribute.
See the following link:
https://msdn.microsoft.com/en-us/library/system.web.http.filters.authorizationfilterattribute.onauthorization(v=vs.118).aspx#M:System.Web.Http.Filters.AuthorizationFilterAttribute.OnAuthorization(System.Web.Http.Controllers.HttpActionContext)