Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AnalyzerHostedService : IHostedService
- {
- public Task StartAsync(CancellationToken cancellationToken)
- {
- return Task.Run(() =>
- {
- // Do the complete
- // - DB Access
- // - Data evaluation
- // - Notifications managment
- // here
- });
- }
- public Task StopAsync(CancellationToken cancellationToken)
- {
- return Task.CompletedTask;
- }
- }
- public void ConfigureServices(IServiceCollection services)
- {
- services.AddHostedService<AnalyzerHostedService>();
- services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement