public async Task Run([TimerTrigger("0 5 0 * * SUN")] TimerInfo myTimer, ILogger log) { var allTowns = await TownService.GetAllTowns(); foreach (var town in allTowns) { await HistoricalTurnipService.SaveTurnipData(town); var newTown = new TownEntity() { PartitionKey = town.PartitionKey, RowKey = town.RowKey, MayorName = town.MayorName, OwnerUsername = town.OwnerUsername, Created = town.Created, ETag = town.ETag, Name = town.Name, NativeFruit = town.NativeFruit, Timestamp = town.Timestamp, TurnipPrices = "0.0.0.0.0.0.0.0.0.0.0.0.0.0", TurnipsOwned = 0 }; await TownService.UpsertTown(newTown); } }
public async Task <TownEntity> Add(string userName, string townName, string mayorName, DateTime createdDate, int nativeFruit) { return(await TownService.UpsertTown(userName, townName, mayorName, createdDate, nativeFruit)); }