using System.Threading;
using System.Threading.Tasks;
using BlueWest.Data.Application;
using Microsoft.Extensions.Hosting;
using Redis.OM;
namespace BlueWest.WebApi
{
public class IndexCreationDevice : IHostedService
{
private readonly RedisConnectionProvider _provider;
///
/// Index Creation Device
///
///
public IndexCreationDevice(RedisConnectionProvider provider)
{
_provider = provider;
}
///
public async Task StartAsync(CancellationToken cancellationToken)
{
await _provider.Connection.CreateIndexAsync(typeof(SessionToken)); }
///
public Task StopAsync(CancellationToken cancellationToken)
{
return Task.CompletedTask; }
}
}