private async Task <bool> RegisterNewUser() { try { int Id = 0; Id = AllUsers.Count == 0 ? 0 : AllUsers.Max(X => X.UserId); var Country = (Country)pickCountry.SelectedItem; bool res = await firebaseHelper.AddNewUser(Id + 1, txtUserName.Text, Country.country, Country.abbreviation, 0); if (res) { return(true); } return(false); } catch (Exception ex) { return(false); } }