Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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;
        }