Skip to content

Instantly share code, notes, and snippets.

@deksoke
Created March 31, 2020 10:40
Show Gist options
  • Save deksoke/08ee4c2d8b1e252932381fc840997224 to your computer and use it in GitHub Desktop.
Save deksoke/08ee4c2d8b1e252932381fc840997224 to your computer and use it in GitHub Desktop.
Create Schedule Job Task in .Net C# Web Application
public class Global : HttpApplication
{
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
TimeSpan intervalTimespan = TimeSpan.FromSeconds(30);
Task.Factory.StartNew(() => {
while (true)
{
DoSomthing(); // JobSchedule_MovePlaceToOnboard("system");
Task.Delay(intervalTimespan);
}
});
}
private void DoSomthing()
{
//
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment