Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

arthuraugsten/cache-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cache Sample

This project is POC (Prove of Concept) for implement cache storage on repositories. The focus is on how to implement a solution for local cache during development and use a Redis for cache on the production environment.

Requirements

  • SQL Server initialized;
  • .NET 5.0.2xx version

Explanation

  • There is a generic interface called ICachedRepository.cs that is responsible for defining the main methods for the service, avoiding a specific technology.
  • The default implementation to get data from cache or set it there is defined on CachedRepository.cs. To use the methods on your repository, you must implement the interface mentioned previously and inherit this class.
  • On Startup.cs is defined the Dependency Injection with the logic to define when to use local or Redis cache.
  • You can see a sample code on CustomerController.cs using the repository that implemented cache solution.
  • I didn't implement Redis logic because the main goal of this POC is to show how to organize the classes and interfaces and see it working with a basic code.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages