Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. public class AnalyzerHostedService : IHostedService
  2. {
  3. public Task StartAsync(CancellationToken cancellationToken)
  4. {
  5. return Task.Run(() =>
  6. {
  7. // Do the complete
  8. // - DB Access
  9. // - Data evaluation
  10. // - Notifications managment
  11. // here
  12. });
  13. }
  14.  
  15. public Task StopAsync(CancellationToken cancellationToken)
  16. {
  17. return Task.CompletedTask;
  18. }
  19. }
  20.  
  21. public void ConfigureServices(IServiceCollection services)
  22. {
  23. services.AddHostedService<AnalyzerHostedService>();
  24.  
  25. services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement