コード例 #1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any movies.
                if (context.Scripture.Any())
                {
                    return;   // DB has been seeded
                }



                context.Scripture.AddRange(
                    new Scripture
                {
                    Canon      = "When Harry Met Sally",
                    Chapter    = 11,
                    Verses     = "Romantic Comedy",
                    Notes      = "111",
                    CreateDate = DateTime.Parse("1989-2-12"),
                },
                    new Scripture
                {
                    Canon      = "When",
                    Chapter    = 22,
                    Verses     = "Romantic Comedy",
                    Notes      = "222",
                    CreateDate = DateTime.Parse("1989-2-12"),
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #2
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any Scriptures.
                if (context.Book.Any())
                {
                    return;   // DB has been seeded
                }

                context.Book.AddRange(
                    new Journal
                {
                    Book      = "Genesis",
                    Chapter   = 1,
                    Verse     = 1,
                    Note      = "This begain it all!",
                    DateAdded = DateTime.Parse("2018-11-5")
                },

                    new Journal
                {
                    Book      = "1 Nephi",
                    Chapter   = 1,
                    Verse     = 1,
                    Note      = "The first verse in the Book of Mormon.",
                    DateAdded = DateTime.Parse("2018-11-5")
                }


                    );
                context.SaveChanges();
            }
        }
コード例 #3
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for scriptures.
                if (context.Scripture.Any())
                {
                    return;   // DB has been seeded
                }

                context.Scripture.AddRange(
                    new Scripture
                {
                    Book      = "Book of Mormon",
                    Reference = "1 Nephi 1:12",
                    Passage   = "And it came to passthat as he read, he was filled with the Spirit of the Lord",
                    Note      = "Reading the scriptures will fill us with the Spirit.",
                    DateAdded = DateTime.Parse("2019-6-6")
                },

                    new Scripture
                {
                    Book      = "Bible",
                    Reference = "Matthew 5:14",
                    Passage   = "Ye are the light of the world. A city that is set on an hill cannnot be hid.",
                    Note      = "We are the light of the world.",
                    DateAdded = DateTime.Parse("2019-6-6")
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #4
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any Scriptures.
                if (context.Book.Any())
                {
                    return;   // DB has been seeded
                }

                context.Book.AddRange(
                    new Journal
                {
                    Book      = "Genesis",
                    Chapter   = 1,
                    Verse     = 1,
                    Note      = "Heavenly Father created us as His image",
                    DateAdded = DateTime.Parse("2018-11-5")
                },

                    new Journal
                {
                    Book      = "1 Nephi",
                    Chapter   = 1,
                    Verse     = 1,
                    Note      = "Lehi was such a good leader",
                    DateAdded = DateTime.Parse("2018-11-5")
                }


                    );
                context.SaveChanges();
            }
        }
コード例 #5
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any movies.
                if (context.Scripture.Any())
                {
                    return;   // DB has been seeded
                }

                context.Scripture.AddRange(
                    new Scripture
                {
                    Title     = "Nephi",
                    Book      = "1st Nephi",
                    Chapters  = "2",
                    Verses    = "3",
                    Note      = "Hello",
                    DateAdded = DateTime.Parse("2019-6-06")
                },

                    new Scripture
                {
                    Title     = "Repentance",
                    Book      = "2nd Nephi",
                    Chapters  = "3",
                    Verses    = "12",
                    Note      = "Hello",
                    DateAdded = DateTime.Parse("2019-6-06")
                },

                    new Scripture
                {
                    Title     = "Nephi",
                    Book      = "Moroni",
                    Chapters  = "10",
                    Verses    = "3-4",
                    Note      = "Hello",
                    DateAdded = DateTime.Parse("2019-6-06")
                },

                    new Scripture
                {
                    Title     = "Nephi",
                    Book      = "Alma",
                    Chapters  = "26",
                    Verses    = "12",
                    Note      = "Hello",
                    DateAdded = DateTime.Parse("2019-6-06")
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #6
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any Journals.
                if (context.Journal.Any())
                {
                    return;   // DB has been seeded
                }

                context.Journal.AddRange(
                    new Journal
                {
                    Book             = "Book of Mormon",
                    DateAdded        = DateTime.Parse("1989-2-12"),
                    BookInScriptures = "Alma",
                    Chapter          = 37,
                    Verse            = 37
                },

                    new Journal
                {
                    Book             = "New Testament",
                    DateAdded        = DateTime.Parse("1984-3-13"),
                    BookInScriptures = "Matthew",
                    Chapter          = 3,
                    Verse            = 18
                },

                    new Journal
                {
                    Book             = "Doctrine & Covenants",
                    DateAdded        = DateTime.Parse("1986-2-23"),
                    BookInScriptures = "Section",
                    Chapter          = 89
                },

                    new Journal
                {
                    Book             = "Pearl of Great Price",
                    DateAdded        = DateTime.Parse("1959-4-15"),
                    BookInScriptures = "Moses",
                    Chapter          = 1,
                    Verse            = 18
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #7
0
 public static void Initialize(IServiceProvider serviceProvider)
 {
     using (var context = new ScriptureJournalContext(
                serviceProvider.GetRequiredService <DbContextOptions <ScriptureJournalContext> >()))
     {
         // Look for any notes
         if (context.Scripture.Any())
         {
             return; // Don't seed DB if it has content.
         }
         context.Scripture.AddRange(
             new Scripture
         {
             Book      = "1 Nephi",
             Chapter   = 3,
             Verse     = 7,
             Note      = "If we trust in the Lord, he will make a way to keep his commandments.",
             DateAdded = DateTime.Parse("2018-5-7")
         },
             new Scripture
         {
             Book      = "1 Nephi",
             Chapter   = 11,
             Verse     = 1,
             Note      = "Nephi had a desire and believed the Lord would answer his prayers.",
             DateAdded = DateTime.Parse("2018-5-7")
         },
             new Scripture
         {
             Book      = "2 Nephi",
             Chapter   = 4,
             Verse     = 29,
             Note      = "Nephi needed to forgive his enemies so they would not be able to destroy his peace.",
             DateAdded = DateTime.Parse("2018-6-15")
         },
             new Scripture
         {
             Book      = "Alma",
             Chapter   = 9,
             Verse     = 6,
             Note      = "The Lord knows people's hearts and prepares us to teach them and gives us what we need.",
             DateAdded = DateTime.Parse("2018-9-26")
         }
             );
         context.SaveChanges();
     }
 }
コード例 #8
0
ファイル: SeedData.cs プロジェクト: Jihusen/ScriptureJournal
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any scripture reference.
                if (context.Scripture.Any())
                {
                    return;   // DB has been seeded
                }

                context.Scripture.AddRange(
                    new Scripture
                {
                    Title     = "How to love Him",
                    DateAdded = DateTime.Parse("2019-10-12"),
                    Book      = "John",
                    Chapter   = 14,
                    Verse     = "15",
                    Notes     = "It seems easy, but when we do not obey, is it like we completely do not love him?"
                },

                    new Scripture
                {
                    Title     = "Sinning Vs. Transgressing",
                    DateAdded = DateTime.Parse("2019-10-13"),
                    Book      = "1 Samuel",
                    Chapter   = 16,
                    Verse     = "7",
                    Notes     = "I feel like it is talking about our intentions in our actions. But how much does that excuse us when we make a wrong choice"
                },

                    new Scripture
                {
                    Title     = "Forgiveness is Achievable",
                    DateAdded = DateTime.Parse("2019-10-23"),
                    Book      = "Doctrine and Covenants",
                    Chapter   = 58,
                    Verse     = "42-43",
                    Notes     = "It is good to know if we repent we will be forgiven. Combine that with how often we will be forgiven it seems reassuring"
                }
                    );

                context.SaveChanges();
            }
        }
コード例 #9
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(serviceProvider.GetRequiredService <DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any journal entries
                if (context.JournalEntry.Any())
                {
                    return; //DB has been seeded
                }

                context.JournalEntry.AddRange(
                    new JournalEntry
                {
                    EntryDate = DateTime.Parse("2020-10-26"),
                    Book      = "Alma",
                    Chapter   = 32,
                    Verse     = 27,
                    Scripture = "But behold, if ye will awake and arouse your faculties, even to an experiment upon my words, and exercise a particle of faith, yea, even if ye can no more than desire to believe, let this desire work in you, even until ye believe in a manner that ye can give place for a portion of my words.",
                    Entry     = "I love this scripture because we don't have to believe right away, we can just have a desire to believe. That desire can grow into beleif and into faith."
                },

                    new JournalEntry
                {
                    EntryDate = DateTime.Parse("2020-10-27"),
                    Book      = "Alma",
                    Chapter   = 33,
                    Verse     = 8,
                    Scripture = "Yea, thou art merciful unto thy children when they cry unto thee, to be heard of thee and not of men, and thou wilt hear them.",
                    Entry     = "If we are sincere in our intent, God will hear us and answer our prayers."
                },

                    new JournalEntry
                {
                    EntryDate = DateTime.Parse("2020-10-27"),
                    Book      = "3 Nephi",
                    Chapter   = 18,
                    Verse     = 15,
                    Scripture = "Verily, verily, I say unto you, ye must watch and pray always, lest ye be tempted by the devil, and ye be led away captive by him.",
                    Entry     = "We should always pray to be strong against temptation."
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #10
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any movies.
                if (context.JournalEntry.Any())
                {
                    return;   // DB has been seeded
                }

                context.JournalEntry.AddRange(
                    new JournalEntry
                {
                    Date = DateTime.Parse("2019-2-12"),
                    Book = "First Nephi",
                    Note = "Test entry"
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #11
0
ファイル: SeedData.cs プロジェクト: ArthurFig1998/CIT365
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any Scriptures.
                if (context.Scriptures.Any())
                {
                    return;   // DB has been seeded
                }

                context.Scriptures.AddRange(
                    new Scripture
                {
                    Book    = BookName.Alma,
                    Chapter = 36,
                    Verse   = 27,
                    Notes   = "Trials"
                }
                    );
                context.SaveChanges();
            }
        }
コード例 #12
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new ScriptureJournalContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <ScriptureJournalContext> >()))
            {
                // Look for any movies.
                if (context.Book.Any())
                {
                    return; // DB has been seeded
                }

                context.Book.AddRange(
                    new Book
                {
                    Title       = "I Nephi",
                    ReleaseDate = DateTime.Parse("2019-2-6"),
                    Genre       = "Book of Mormon",
                    Price       = 7.99M,
                    Notes       = "I like this scripture",
                },

                    new Book
                {
                    Title       = "Section 93",
                    ReleaseDate = DateTime.Parse("2015-3-12"),
                    Genre       = "Doctrine and Covenants",
                    Price       = 93.53M,
                    Notes       = "It's easy to think that all we really need to read is the BoM but it says right here there is good info in the Bible too",
                },

                    new Book
                {
                    Title       = "Abraham",
                    ReleaseDate = DateTime.Parse("2013-2-23"),
                    Genre       = "Pearl of Great Price",
                    Price       = 3.7m,
                    Notes       = "We don't always understand everything",
                },

                    new Book
                {
                    Title       = "II Nephi",
                    ReleaseDate = DateTime.Parse("2017-4-25"),
                    Genre       = "Book of Mormon",
                    Price       = 13.8M,
                    Notes       = "",
                },
                    new Book
                {
                    Title       = "Ezra",
                    ReleaseDate = DateTime.Parse("2019-3-15"),
                    Genre       = "Old Testament",
                    Price       = 7.8M,
                    Notes       = "He was king a long time!",
                },
                    new Book
                {
                    Title       = "II Nephi",
                    ReleaseDate = DateTime.Parse("2013-8-15"),
                    Genre       = "Book of Mormon",
                    Price       = 3.25M,
                    Notes       = "",
                },
                    new Book
                {
                    Title       = "Section 40",
                    ReleaseDate = DateTime.Parse("2001-9-5"),
                    Genre       = "Doctrine and Covenants",
                    Price       = 40.2M,
                    Notes       = "Better watch out",
                }
                    );
                context.SaveChanges();
            }
        }