public static PhotosForUserCache ( string user ) : string | ||
user | string | |
Результат | 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 ClearUserCacheAsync(string user) { await RedisCache.ClearCacheForKeyAsync(_cache, RedisConfig.PhotosForUserCache(user)); }
public async Task AddPhotoToUserCacheAsync(IPhotoModel photo) { //Add to list of user-specific photos await RedisCache.ListLeftPushAsync <IPhotoModel>(_cache, RedisConfig.PhotosForUserCache(photo.Owner), photo); }
public async Task <IEnumerable <IPhotoModel> > GetPhotosForUserAsync(string user) { return(await RedisCache.ListRangeAsync <IPhotoModel>(_cache, RedisConfig.PhotosForUserCache(user))); }