Skip to content

aclima01/Net8FullApiTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Add Postgres Sql Docker Container

myproject.database:
  image: postgres:latest
  container_name: myproject.database
  environment:
    - POSTGRES_DB=myproject
    - POSTGRES_USER=postgres
    - POSTGRES_PASSWORD=postgres
  volumes:
    - ./.containers/myproject-db:/var/lib/postgresql/data
  ports:
    - 5432:5432

Add Redis Cach Docker Container

myproject.cache:
  image: redis:latest
  restart: always
  ports:
    - 6379:6379
"Cache": "myproject.cache:6379"
var sample = await cache.GetAsync($"samples-{id}",
    async token =>
    {
        var sample = await context.Samples
            .AsNoTracking()
            .FirstOrDefaultAsync(p => p.Id == id, token);

        return sample;
    },
    CacheOptions.DefaultExpiration);

About

My Custom Full Api Template

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages