Last active
August 15, 2018 16:55
-
-
Save juucustodio/58d01f54bd40a0a11f91b062b15f4d20 to your computer and use it in GitHub Desktop.
Example of how to implement local database in your Xamarin.Forms applications - http://julianocustodio.com/litedb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Insert(object sender, System.EventArgs e) | |
{ | |
int idCustomer = Customers.Count() == 0 ? 1 : (int) (Customers.Max(x => x.Id) + 1); | |
Customer customer = new Customer | |
{ | |
Id = idCustomer, | |
Name = EntryName.Text, | |
}; | |
Customers.Insert(customer); | |
ListCustomers.ItemsSource = Customers.FindAll(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment