setup azure function on a schedule and deploy

This commit is contained in:
2020-03-20 00:12:38 -04:00
parent 0bfab99f1b
commit 0b61fbf44a
7 changed files with 459 additions and 24 deletions

View File

@@ -47,9 +47,9 @@ namespace Habitica.Todoist.Integration.Services
var result = await table.ExecuteAsync(operation);
return result.Result as T;
}
}
public async Task<bool> Exists<T>(string partitionKey, string rowKey) where T : TableEntity, new()
public async Task<bool> ExistsAsync<T>(string partitionKey, string rowKey) where T : TableEntity, new()
{
var tableName = typeof(T).Name.ToLower();
var table = tables[tableName];
@@ -60,17 +60,10 @@ namespace Habitica.Todoist.Integration.Services
return result.Result != null;
}
//public async Task<List<T>> Read<T>(string partitionKey, string rowKey) where T : TableEntity
//{
// var tableName = typeof(T).Name.ToLower();
// var table = tables[tableName];
// var operation = TableOperation.Retrieve(partitionKey, rowKey);
// var result = await table.ExecuteAsync(operation);
// return result.Result != null;
//}
public bool Exists<T>(string partitionKey, string rowKey) where T : TableEntity, new()
{
return Query<T>().Where(x => x.PartitionKey == partitionKey && x.RowKey == rowKey).ToList().Any();
}
public TableQuery<T> Query<T>() where T : TableEntity, new()
{