Exemplo n.º 1
0
        private void Delete_Button_Click(object sender, RoutedEventArgs e)
        {
            using (var db = new SynthDB())
            {
                db.Remove(currentMelodie);

                db.SaveChanges();
            }
        }
Exemplo n.º 2
0
 private void Save_Button_Click(object sender, RoutedEventArgs e)
 {
     Console.WriteLine("hello");
     using (var db = new SynthDB())
     {
         if (currentMelodie == null)
         {
             var m = new Melodie
             {
                 CharMelodie = MelodieBox.Text
             };
             currentMelodie = m;
             db.Melodies.Add(m);
         }
         else
         {
             db.Melodies.Update(currentMelodie);
         }
         db.SaveChanges();
     }
 }