nerdexam
Microsoft

AZ-204 · Question #149

A development team is developing an application. The application will be working with customer data. The application will also be making use of Azure Redis Cache. You need to invalidate the cache…

The correct answer is A. IDatabase cache=Connection.GetDatabase(). The right way is to use the IDatabase interface. Also you need to use the GetDatabase() method. This is also mentioned in the Microsoft documentation. Since this is clearly given in the Microsoft documentation, all other options are incorrect…

Submitted by layla.eg· Mar 30, 2026Develop for Azure storage

Question

A development team is developing an application. The application will be working with customer data. The application will also be making use of Azure Redis Cache. You need to invalidate the cache when the customer data is changed. You have to complete the below code to comply with the requirement Which of the following will go into Slot1?

Exhibit

AZ-204 question #149 exhibit

Options

  • AIDatabase cache=Connection.GetDatabase();
  • BIDatabase cache=Connection.GetCache();
  • CICache cache=Connection.GetDatabase();
  • DICache cache=Connection.GetCache();

How the community answered

(49 responses)
  • A
    73% (36)
  • B
    8% (4)
  • C
    4% (2)
  • D
    14% (7)

Explanation

The right way is to use the IDatabase interface. Also you need to use the GetDatabase() method. This is also mentioned in the Microsoft documentation. Since this is clearly given in the Microsoft documentation, all other options are incorrect. https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-dotnet-how-to-use-azure-

Topics

#Azure Cache for Redis#IDatabase#StackExchange.Redis#cache connection

Community Discussion

No community discussion yet for this question.

Full AZ-204 Practice