public static PhotoByIDCache ( string id ) : string | ||
id | string | |
return | string |
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); }
public async Task ClearCacheItemAsync(string id) { await RedisCache.ClearCacheForKeyAsync(_cache, RedisConfig.PhotoByIDCache(id)); }
public async Task <IPhotoModel> GetPhotoByIDAsync(string id) { return(await RedisCache.GetAsync <IPhotoModel>(_cache, RedisConfig.PhotoByIDCache(id))); }