Microsoft
70-513 · Question #243
70-513 Question #243: Real Exam Question with Answer & Explanation
Sign in or unlock 70-513 to reveal the answer and full explanation for question #243. The question stem and answer options stay visible for context.
Question
You are developing a Windows Communication Foundation (WCF) service to provide an in- memory cache. The following code is part of your solution. (Line numbers are included for reference only.) 02 Public Interface IlnMemoryCacheService 04 <OperationContract()> 05 Function GetCachedItem( ByVal key As String) As String 07 <OperationContract() > 08 Sub CacheItem( ByVal key As String, ByVal item As String) 10 End Interface 12 <ServiceBehavior( InstanceContextMode:=InstanceContextHode.Single)> 13 Public Class CacheService 14 Implements IlnHemoryCacheService 16 Dim cache As Hashtatale - New Hashtable)> 18 Public Function GetCachedItem( ByVal key As String) As String mplements IInHemoryCacheService.GetCachedltem 20 Return cache (key) .ToStrlng() 22 End Function 24 Public Sub Cacheltem( ByVal key As String, ByVal item As String) Implements ilnMemoryCacheService.Cacheltem Then 26 If (cache.Contains(key) 27 cache.Remove(key) 28 End If 30 cache.Add(key, item) 32 End Sub 34 End Class Users report that the cache is getting updated with cache changes of other users. You need to ensure that each user's cache is maintained and isolated from other users. Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Options
- AInsert the following code at line 01.
- BAt line 12, replace InstanceContextMode.Single with
- CAt line 12, replace InstanceContextMode.Single with
- DInsert the following code at line 01.
Unlock 70-513 to see the answer
You've previewed enough free 70-513 questions. Unlock 70-513 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.