Пример #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new Scripture_JournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <Scripture_JournalContext> >()))
            {
                // Look for any movies.
                if (context.Scripture.Any())
                {
                    return;   // DB has been seeded
                }

                context.Scripture.AddRange(
                    new Scripture_Journal.Models.Scripture
                {
                    Collection = "New Testament",
                    Book       = "Matthew",
                    Chapter    = 7,
                    Verse      = 7,
                    Notes      = "Knock and it will open"
                },
                    new Scripture_Journal.Models.Scripture
                {
                    Collection = "Book of Mormon",
                    Book       = "Mornoni",
                    Chapter    = 10,
                    Verse      = 2,
                    Notes      = "WOW, I CAN ADD NOTES"
                }
                    );
                context.SaveChanges();
            }
        }
Пример #2
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new Scripture_JournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <Scripture_JournalContext> >()))
            {
                // Look for any movies.
                if (context.Entry.Any())
                {
                    return;   // DB has been seeded
                }

                context.Entry.AddRange(
                    new Entry
                {
                    DateAdded  = DateTime.Parse("2020-1-12"),
                    Book       = "John",
                    Chapter    = 3,
                    VerseRange = "16",
                    Notes      = "God loved mankind enough to offer his beloved son to die for us."
                },

                    new Entry
                {
                    DateAdded  = DateTime.Parse("2019-12-1"),
                    Book       = "Jeremiah",
                    Chapter    = 1,
                    VerseRange = "5",
                    Notes      = "He knew Jeremiah before he was born, evidence of a pre-earth existence is demonstrated here."
                },

                    new Entry
                {
                    DateAdded  = DateTime.Parse("2019-12-15"),
                    Book       = "Matthew",
                    Chapter    = 4,
                    VerseRange = "19",
                    Notes      = "The simple charge of the savior to come and follow him"
                },

                    new Entry
                {
                    DateAdded  = DateTime.Parse("2020-1-12"),
                    Book       = "1 Nephi",
                    Chapter    = 3,
                    VerseRange = "7",
                    Notes      = "The lord will provide a way for us to accomplish his commands"
                }
                    );
                context.SaveChanges();
            }
        }
Пример #3
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new Scripture_JournalContext(serviceProvider.GetRequiredService <DbContextOptions <Scripture_JournalContext> >()))
            {
                // Look for records in the DB
                if (context.ScriptureNote.Any())
                {
                    return;
                }

                context.ScriptureNote.AddRange(

                    new ScriptureNote
                {
                    Title            = "Note 1",
                    EntryDate        = DateTime.Parse("2020-2-12"),
                    ScriptureBook    = "1 Ne",
                    ScriptureChapter = "1",
                    ScriptureVerse   = "1",
                    JournalEntry     = "This is an entry into the journal"
                },

                    new ScriptureNote
                {
                    Title            = "Humility",
                    EntryDate        = DateTime.Parse("2020-1-12"),
                    ScriptureBook    = "2 Ne",
                    ScriptureChapter = "2",
                    ScriptureVerse   = "12",
                    JournalEntry     = "This is why we should pay attention"
                },

                    new ScriptureNote
                {
                    Title            = "Darkness",
                    EntryDate        = DateTime.Parse("2020-1-23"),
                    ScriptureBook    = "Alma",
                    ScriptureChapter = "32",
                    ScriptureVerse   = "1",
                    JournalEntry     = "Example of not learning what we should learn"
                }
                    );
                context.SaveChanges();
            }
        }
 public DeleteModel(Scripture_Journal.Models.Scripture_JournalContext context)
 {
     _context = context;
 }
Пример #5
0
 public EditModel(Scripture_Journal.Models.Scripture_JournalContext context)
 {
     _context = context;
 }