public async void DoClose() { entereduUser = new UserTableDatabaseAzure(); var details = await entereduUser.GetUser(); foreach (var detail in details) { if (detail.Name == "Kazuko") { _userid = detail.Id; } } entered.UserID = _userid; entered.FoodID = _foodid; entered.Date = DateTime.Now; enteredFood = new FoodEnteredTableDatabaseAzure(); bool _checked = await enteredFood.CheckIfExists(entered); if (!_checked) { await enteredFood.InsertFood(entered); } //Close(JourneyFoodViewModel); Close(this); }