public async Task <IEnumerable <Tarea> > GetTareas() { return(await Task.Run(() => { var tareas = new Tarea[] { new Tarea { Descripcion = "Conocer Xamarin", Completada = true }, new Tarea { Descripcion = "Aprender Xamarin", Completada = false }, new Tarea { Descripcion = "Desarrollar en Xamarin", Completada = false } }; return tareas; })); }
public async Task <IEnumerable <Tarea> > GetTareas() { var tareas = await db.Table <Tarea>().ToListAsync(); if (tareas.Count == 0) { var nuevasTaras = new Tarea[] { new Tarea { Descripcion = "Conocer Xamarin", Completada = true }, new Tarea { Descripcion = "Aprender Xamarin", Completada = false }, new Tarea { Descripcion = "Desarrollar en Xamarin", Completada = false } }; await db.InsertAllAsync(nuevasTaras); tareas = await db.Table <Tarea>().ToListAsync(); } return(tareas); }
public override void Init(object initData) { base.Init(initData); SelectedTarea = (initData as Tarea); }
public Task UpdateTarea(Tarea tarea) { throw new NotImplementedException(); }
public Task InsertTarea(Tarea tarea) { throw new NotImplementedException(); }
public Task UpdateTarea(Tarea tarea) { return(db.UpdateAsync(tarea)); }
public Task InsertTarea(Tarea tarea) { return(db.InsertAsync(tarea)); }
public Task DeleteTarea(Tarea tarea) { return(db.DeleteAsync(tarea)); }