Exemplo n.º 1
0
        public TodoCacheRepository(
            ITodoCache todoCache,
            IDbConnection db,
            ILogger <TodoRepository> logger = null)
            : base(db, logger)
        {
            this.todoCache = todoCache;

            // Initialize Cache with all items
            if (this.todoCache.SourceCache.Count == 0)
            {
                this.todoCache.SourceCache.AddOrUpdate(base.GetAll(0, 1000).Items);
            }
        }
Exemplo n.º 2
0
 public TodoController(ITodoRepository repository, ITodoCache cache, ILogger <TodoController> logger)
 {
     this.repository = repository;
     this.cache      = cache;
     _logger         = logger;
 }
Exemplo n.º 3
0
 public TodoController(ITodoRepository todoRepository, ITodoCache todoCache)
 {
     _todoRepository = todoRepository;
     _cache          = todoCache;
 }