public async Task UpdateDB(Category[] categories) { try { //because Categories from json haven't any id = haven't primary key. //So i should did it (that duplicates do not appear). await GetConnection().DeleteAllAsync <Category>(); await GetConnection().DeleteAllAsync <Subject>(); await WriteOperations.InsertOrReplaceAllWithChildrenAsync(GetConnection(), categories).ContinueWith(async(arg) => { Debug.WriteLine("[DataStorage.UpdateDB]: DB updated!"); await Delegate.DataBaseUdpated(); }); } catch (SQLiteException ex) { Debug.WriteLine(ex.Message); } }
public Task SaveAllMilestonesAsync(List <Milestone> milestones) { return(WriteOperations.InsertOrReplaceAllWithChildrenAsync(_asyncConnection, milestones)); }
public Task SaveAllVaccinesAsync(List <Vaccine> vaccines) { return(WriteOperations.InsertOrReplaceAllWithChildrenAsync(_asyncConnection, vaccines)); }