<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Open_School_Library.Models.DatabaseModels;

namespace Open_School_Library.Data
{
    public class DbInitializer
    {
        public static void Initialize(LibraryContext context)
        {
            context.Database.EnsureCreated();

            //Look for Students
            if(context.Students.Any())
            {
                return; //DB has been seeded
            }

            var students = new Student[]
            {
                new Student { FirstName="John", LastName="Tell", Email="<EMAIL>", Grade=3, HomeRoomTeacher=1, Fines=1.50M, IssusedID=10254 }
            };

            foreach (Student s in students)
            {
                context.Students.Add(s);
            }

            context.SaveChanges();

            var genres = new Genre[]
            {
                new Genre { Name="Horror" },
                new Genre { Name="Romance" }
            };

            foreach (Genre s in genres)
            {
                context.Genres.Add(s);
            }

            context.SaveChanges();

            var deweys = new Dewey[]
            {
                new Dewey { Name="Computer Science, Information & General Works", Number=000 },
                new Dewey { Name="Philosophy & Psychology", Number=100 },
                new Dewey { Name="Religion", Number=200 }
            };

            foreach (Dewey s in deweys)
            {<commit_msg>Add test data for Teacher to DbInitializer.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using System.Threading.Tasks;
using Open_School_Library.Models.DatabaseModels;

namespace Open_School_Library.Data
{
    public class DbInitializer
    {
        public static void Initialize(LibraryContext context)
        {
            context.Database.EnsureCreated();

            //Look for Students
            if(context.Students.Any())
            {
                return; //DB has been seeded
            }

            var students = new Student[]
            {
                new Student { FirstName="John", LastName="Tell", Email="<EMAIL>", Grade=3, HomeRoomTeacher=1, Fines=1.50M, IssusedID=10254 }
            };

            foreach (Student s in students)
            {
                context.Students.Add(s);
            }

            context.SaveChanges();

            var teachers = new Teacher[]
            {
                new Teacher {FirstName="Erik", LastName="Henderson", Grade=3 }
            };

            foreach (Teacher s in teachers)
            {
                context.Teachers.Add(s);
            }

            context.SaveChanges();

            var genres = new Genre[]
            {
                new Genre { Name="Horror" },
                new Genre { Name="Romance" }
            };

            foreach (Genre s in genres)
            {
                context.Genres.Add(s);
            }

            context.SaveChanges();

            var deweys = new Dewey[]
            {
                new Dewey { Name="Computer Science, Information & General Works", Number=000 },
                new Dewey { Name="Philosophy & Psychology", Number=100 },
                new Dewey { Name="Religion", Number=200 }
            };

            foreach (Dewey s in deweys)
            {
{'fraction_non_alphanumeric': 0.09498308906426156, 'fraction_numerical': 0.010992108229988726, 'mean_word_length': 1.5459110473457676, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2509', 'n_tokens_mistral': 966, 'n_tokens_neox': 870, 'n_words': 216}