Posted by: Pdfprep
Post Date: December 30, 2020
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. Choose all that apply.)
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());
Answer: A,C
Leave a Reply