Skip to content

Library that help in configuring new dot net core web job project

License

Notifications You must be signed in to change notification settings

AndroThink/WebJobCore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AndroThink.WebJob.Core Nuget

Library that help in configuring new dot net core web job project

How to use

In Your Control

var job = CoreWebJob.Create("appsettings.json", true)
    .ConfigureWebJobs(options =>
    {

    }).ConfigureLogging((context, logging) =>
    {
        logging.AddConsole();
        logging.SetMinimumLevel(LogLevel.Trace);
    })
    .ConfigureServices((context, services) =>
    {
        services.AddSingleton<IMailSender,MailSender>();

        services.AddHostedService<TestService>(); // this inherites from BaseHostedService OR BaseBackgroundService
    })
    .WithFileLogger("Logs");

await job.RunAsync((sender, args) =>
{
    Exception ex = (Exception)args.ExceptionObject;

    Console.WriteLine("Webjob exception ==> " + ex.ToString());
});

About

Library that help in configuring new dot net core web job project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages