Beispiel #1
0
 public AdminController(
     ILogger <AdminController> logger,
     IeemdbDbContext ctx,
     IPureMapper mapper,
     IEnumerable <IHostedService> hostedServices)
     : base(logger, ctx, mapper)
 {
     deleteService = hostedServices.OfType <DeletedCleanupService>().SingleOrDefault()
                     ?? throw new InvalidOperationException(
                               $"Could not locate an instance of the service {nameof(DeletedCleanupService)}");
     movieSeedService = hostedServices.OfType <MovieSyncingService>().SingleOrDefault()
                        ?? throw new InvalidOperationException(
                                  $"Could not locate an instance of the service {nameof(MovieSyncingService)}");
     tokenCleanupService = hostedServices.OfType <RefreshTokenCleanupService>().SingleOrDefault()
                           ?? throw new InvalidOperationException(
                                     $"Could not locate an instance of the service {nameof(RefreshTokenCleanupService)}");
 }