public async Task <IViewComponentResult> InvokeAsync() { var user = await _redis.GetStringAsync <Person>("firat"); // if(user == null) // { // await _redis.SetStringAsync("firat", PersonContainer.user); // } return(View(user)); }
public async Task StartAsync(CancellationToken cancellationToken) { _appLifetime.ApplicationStarted.Register(OnStarted); _appLifetime.ApplicationStopping.Register(OnStopping); _appLifetime.ApplicationStopped.Register(OnStopped); await _redis.GetSubscriber().SubscribeAsync("ConfigurationUpdate", async(channel, message) => { if (message.HasValue) { _logger.LogInformation("in subscription."); var result = await _redis.GetStringAsync <string>("Config"); _logger.LogInformation($"{result}"); } }); }