December 2019
Intermediate to advanced
598 pages
12h 21m
English
We are going to implement a cache for the questions using the memory cache in ASP.NET Core:
using QandA.Data.Models;namespace QandA.Data{ public interface IQuestionCache { QuestionGetSingleResponse Get(int questionId); void Remove(int questionId); void Set(QuestionGetSingleResponse question); }}
So, we need the cache implementation to have methods for getting, removing, and updating an item in the cache.
using Microsoft.Extensions.Caching.Memory; using QandA.Data.Models;namespace QandA.Data{ public class QuestionCache: IQuestionCache { // TODO - create a memory cacheRead now
Unlock full access