public Products GetProductDetails(int productId) { RedisKeyParameters redisObj = new RedisKeyParameters(); string ProductKey = RedisCacheManager.GetRedisKey("ProductKey", redisObj); return(RedisCacheManager.GetHashItemValue <Products>(ProductKey, productId.ToString())); }
public BidDetails LastBidOfUser(int userId, int productId) { BidDetails latestBid = null; RedisKeyParameters redisObj = new RedisKeyParameters { UserId = userId, ProductId = productId }; string bidHashAllKey = RedisCacheManager.GetRedisKey("BidHashKey", redisObj); string bidSortedSetSupplierKey = RedisCacheManager.GetRedisKey("AllBidsSortedSetForSupplierKey", redisObj); RedisValue[] redisValuesSortedSet; redisValuesSortedSet = RedisCacheManager.GetSortedSetRangeByRankDescending(bidSortedSetSupplierKey, 0, 0); if (redisValuesSortedSet != null && redisValuesSortedSet.Any()) { latestBid = RedisCacheManager.GetHashItemValue <BidDetails>(bidHashAllKey, redisValuesSortedSet[0]); } return(latestBid ?? null); }