PhotoByIDCache() public static method

public static PhotoByIDCache ( string id ) : string
id string
return string
Exemplo n.º 1
0
        public async Task AddPhotoToCachesAsync(IPhotoModel photo)
        {
            //Add to list of all user photos
            await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.AllUsersCache, photo);

            //Add to list of user-specific photos
            await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.PhotosForUserCache(photo.Owner), photo);

            //Add single item to cache
            await RedisCache.SetAsync <IPhotoModel>(_cache, RedisConfig.PhotoByIDCache(photo.ID), photo);
        }
Exemplo n.º 2
0
 public async Task ClearCacheItemAsync(string id)
 {
     await RedisCache.ClearCacheForKeyAsync(_cache, RedisConfig.PhotoByIDCache(id));
 }
Exemplo n.º 3
0
 public async Task <IPhotoModel> GetPhotoByIDAsync(string id)
 {
     return(await RedisCache.GetAsync <IPhotoModel>(_cache, RedisConfig.PhotoByIDCache(id)));
 }