private void btnAddUpdate_Click(object sender, RoutedEventArgs e) { var context = new GBDBContext(); GBStory story = new GBStory() { Title = txtTitle.Text }; context.GBStory.Add(story); context.SaveChanges(); addMode = false; }
private void btnAddUpdate_Click(object sender, RoutedEventArgs e) { // add or update story block var context = new GBDBContext(); GBStoryBlock storyBlock = new GBStoryBlock() { Text = txtStoryBlock.Text }; context.GBStoryBlocks.Add(storyBlock); context.SaveChanges(); addMode = false; }