Hey guys,
Recently our company decided to change our database work to work with Microsoft Azure, however having gone through most of their documentation and support chats nothing seems to be working.
The issue is this, we run our code and get the insert into the database, but the await never returns and our code is stuck after having done any database operation.
Here is the script:
void Start()
{
Task.Run(TestTableConnection);
}
private async Task TestTableConnection()
{
var table = AzureMobileServiceClient.Client.GetTable<Categories>();
Debug.Log("Testing InsertAsync...");
await TestInsertAsync(table);
Debug.Log("Testing ToListAsync...");
await TestToListAsync(table);
Debug.Log("Testing DeleteAsync...");
//await TestDeleteAsync(table);
Debug.Log("All testing complete.");
}
private async Task TestInsertAsync(IMobileServiceTable<Categories> table)
{
try
{
//var allEntries = await TestToListAsync(table);
//var initialCount = allEntries.Count();
await table.InsertAsync(new Categories { categoryName = "NewTest" });
Debug.Log("I added stuff to the table"); // This part never gets printed to Unity but the insert happens to the database
//allEntries = await TestToListAsync(table);
//var newCount = allEntries.Count();
//Debug.Assert(newCount == initialCount + 1, "InsertAsync failed!");
}
catch (Exception)
{
throw;
}
}
}
I hope my question makes sense, otherwise just give me a heads up and I’ll provide a more detailed explanation.