Ejemplo n.º 1
0
 private static Note MapNote(note n)
 {
     string[] notes = n.flds.Split('\u001f');
     return(new Note()
     {
         Front = notes[0],
         Back = notes[1],
         Details = notes[2],
         Id = n.id
     });
 }
Ejemplo n.º 2
0
        public void SaveNote(Note note)
        {
            using (var db = new AnkiEntities(_connectionString))
            {
                ////db.Database.Connection.
                var tempNote = db.notes.Where(n => n.id == note.Id).First();
                if (tempNote == null)
                {
                    tempNote = new note();
                }

                tempNote.flds = string.Join('\u001f'.ToString(), new string[] { note.Front, note.Back, note.Details });
                db.SaveChanges();
            }
        }