I am trying to have a console application call Azure mobile services to perform an insert in the DB (a test prototype I am trying out. My eventual goal is to have the console app be run on a regular schedule as an Azure webjob).

The code snippet below does an insert. When I comment out the Console.readline(), the program just runs and exits but does nothing (fails to insert). When I have the readline() in there, it can successfully insert. I am guessing this is because I am calling an async method and control just flows out of main even before async method has a chance to complete.

In the eventual application I am trying to develop, the console app would kick off a lengthy update operation, wait for it to complete and then exit until the azure web jobs scheduler runs it again. What is the recommended way to accomplish the 'await' here?

```
class Program
{
    static IMobileServiceTable<TodoItem> todoTable;

    static void Main(string[] args)
    {
        MobileServiceClient MobileService = new MobileServiceClient(
        "mymobileservice url",
        "my application ID"
        );

        todoTable = MobileService.GetTable<TodoItem>();

        todoTable.InsertAsync(new TodoItem() { Text = "Console Item 2", Complete = false });

        //Console.ReadLine();

    }        
}

```