Ejemplo n.º 1
0
        public async Task <List <Note> > GetAllNotes()
        {
            using (var conn = new SQLiteConnection(_connectionString))
            {
                conn.Open();

                using (var reader = await new SQLiteCommand(SQLQueries.GetAllNotes(), conn)
                                    .ExecuteReaderAsync())
                {
                    var notes = new List <Note>();

                    while (reader.Read())
                    {
                        notes.Add(ReadNoteFromSQL(reader));
                    }

                    return(notes);
                }
            }
        }