public async Task CreateSampleChaptersAsync()
        {
            var chapters = new List <BookChapter>();

            for (int i = 0; i < 8; i++)
            {
                chapters.Add(new BookChapter
                {
                    Number = i,
                    Title  = sampleTitles[i],
                    Pages  = numberPages[i]
                });
            }
            await _bookChaptersService.AddRangeAsync(chapters);
        }
Ejemplo n.º 2
0
        public void CreateSampleChapters()
        {
            var chapters = new List <BookChapter>();

            for (int i = 0; i < 9; i++)
            {
                chapters.Add(new BookChapter
                {
                    Number = chapterNumbers[i],
                    Title  = sampleTitles[i],
                    Pages  = numberPages[i]
                });
            }
            _bookChaptersService.AddRangeAsync(chapters);
        }