public async Task <CupOfCoffee> AddCoffee(bool atHome) { await Initialize(); var coffee = new CupOfCoffee { DateUtc = DateTime.UtcNow, MadeAtHome = atHome, OS = Device.OS.ToString() }; await _coffeeTable.InsertAsync(coffee); await SyncCoffee(); return(coffee); }
public async Task <CupOfCoffee> AddCoffee(bool atHome, string location) { await Initialize(); var coffee = new CupOfCoffee { DateUtc = DateTime.UtcNow, MadeAtHome = atHome, OS = Device.RuntimePlatform, Location = location ?? string.Empty }; await coffeeTable.InsertAsync(coffee); await SyncCoffee(); //return coffee return(coffee); }
public async Task<CupOfCoffee> AddCoffee(bool atHome) { await Initialize(); var time = Xamarin.Insights.TrackTime("AddCoffeeTime"); time.Start(); //create and insert coffee var coffee = new CupOfCoffee { DateUtc = DateTime.UtcNow, MadeAtHome = atHome, OS = Device.OS.ToString() }; await coffeeTable.InsertAsync(coffee); time.Stop(); //Synchronize coffee await SyncCoffee(); return coffee; }
public async Task <CupOfCoffee> AddCoffee(bool atHome) { await Initialize(); var time = Xamarin.Insights.TrackTime("AddCoffeeTime"); time.Start(); //create and insert coffee var coffee = new CupOfCoffee { DateUtc = DateTime.UtcNow, MadeAtHome = atHome, OS = Device.OS.ToString() }; await coffeeTable.InsertAsync(coffee); time.Stop(); //Synchronize coffee await SyncCoffee(); return(coffee); }
public async Task<CupOfCoffee> AddCoffee(bool atHome) { await Initialize(); var coffee = new CupOfCoffee { DateUtc = DateTime.UtcNow, MadeAtHome = atHome, OS = Device.OS.ToString() }; await coffeeTable.InsertAsync(coffee); await SyncCoffee(); //return coffee return coffee; }