-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCacheNews.cs
30 lines (28 loc) · 896 Bytes
/
CacheNews.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using System;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
namespace uk.me.timallen.infohub
{
public static class CacheNews
{
[FunctionName("CacheNews")]
[return: Table("news")]
public static NewsArticles Run([TimerTrigger("* 0 */6 * * *")]TimerInfo myTimer, ILogger log)
//public static NewsArticles Run([TimerTrigger("* * * * * *")]TimerInfo myTimer, ILogger log)
{
var result = new NewsArticles
{
PartitionKey = "bbc-news",
RowKey = Guid.NewGuid().ToString(),
Articles = News.GetNews()
};
return result;
}
public class NewsArticles
{
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public string Articles { get; set; }
}
}
}