You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Dotnet core Hosted Services Scheduler
[![Build Status](https://travis-ci.org/Fazzani/hosted-services-scheduler.svg?branch=master)](https://travis-ci.org/Fazzani/hosted-services-scheduler)
Api for Scheduling dotnet core hosted service
Example
```csharp
public class QuoteOfTheDayTask : IScheduledTask
{
public string Schedule => "* */6 * * *";
public async Task ExecuteAsync(CancellationToken cancellationToken)
{
var httpClient = new HttpClient();
var quoteJson = JObject.Parse(await httpClient.GetStringAsync("http://quotes.rest/qod.json"));
QuoteOfTheDay.Current = JsonConvert.DeserializeObject(quoteJson["contents"]["quotes"][0].ToString());
}
}
public class QuoteOfTheDay
{
public static QuoteOfTheDay Current { get; set; }
static QuoteOfTheDay()
{
Current = new QuoteOfTheDay { Quote = "No quote", Author = "Maarten" };
}
public string Quote { get; set; }
public string Author { get; set; }
}
```# synker-media-server