public ActionResult <List <ProductDTO> > FindBestSeller() { //Get in cache var re = _cache.Get <List <ProductDTO> >(CacheKey.SELLER_PRODUCT); if (re != null || re?.Count > 0) { return(re); } //Get in db var products = GetListProducts(); if (products == null) { return(Problem(statusCode: 500, detail: "Data not exist")); } re = _productModel.FindBestSeller(products); if (re == null) { return(Problem(statusCode: 500, detail: "Data not exist")); } _cache.Set(re, CacheKey.SELLER_PRODUCT); return(re); }