PrepAway - Latest Free Exam Questions & Answers

Which code segment can you use?

The GetVendors() action in the ProcessedOrderController controller is querying the database each time it is
run. The GetVendors() action must query the database only if the cache is null.
You need to add code to the action at line PC33 to cache the data. Which code segment can you use? (Each
correct answer presents a complete solution. Chooseall that apply.)

PrepAway - Latest Free Exam Questions & Answers

A.
cache.Set(new CacheItem(“vendorKey”, vendors), GetVendorPolicy());

B.
cache.Add(“vendors”, vendors, new CacheItemPolicy());

C.
cache.Add(new CacheItem(“vendorKey”, vendors) , GetVendorPolicy());

D.
cache.AddOrGetExisting(“vendorKey”, context, new CacheItemPolicy());


Leave a Reply