Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
private void _btnAddPerson_Click(object sender, EventArgs e)
{
var name = _inputName.Text;
var lastName = _inputLastName.Text;
var id = PeopleRepository.SavePerson(new Person
{
Name = name,
LastName = lastName
});
var person = PeopleRepository.GetPerson(id);
if (person == null)
Toast.MakeText(this, $"Person: Name={name}, LastName={lastName} wasn't properly saved!", ToastLength.Long).Show();
else
Toast.MakeText(this, $"Person saved, details: {person}", ToastLength.Long).Show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment