Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Last active August 15, 2018 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/58d01f54bd40a0a11f91b062b15f4d20 to your computer and use it in GitHub Desktop.
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
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