Exemple #1
0
        private async void btnAddCustomer_Click(object sender, RoutedEventArgs e)
        {
            long id = await SqliteContext.CreateCustomerAsync(new Customer(tbxFirstName.Text, tbxLastName.Text));

            // Update list by fetching from database for good measures
            CustomerViewModel.Customers.Add(SqliteContext.GetCustomerByIdAsync(id).GetAwaiter().GetResult());
        }
        public static async Task PopulateByStatusAsync(string status, int maxItemsCount)
        {
            _issues.Clear();
            List <Issue> list = await SqliteContext.GetIssuesByStatusAsync(status, maxItemsCount);

            foreach (Issue issue in list)
            {
                issue.Comments = await SqliteContext.GetCommentsByIssueIdAsync(issue.Id, maxItemsCount);

                issue.Customer = await SqliteContext.GetCustomerByIdAsync(issue.CustomerId);

                _issues.Add(issue);
            }
        }