コード例 #1
0
        public void CreateFakeData(BaseballDBContext database)
        {
            _firstPerson = new Fielding()
            {
                Pos      = "2B",
                YearId   = 2000,
                A        = 20,
                E        = 100,
                PlayerId = "id"
            };

            _secondPerson = new Fielding()
            {
                Pos      = "P",
                YearId   = 2001,
                A        = 10,
                E        = 200,
                PlayerId = "anotherId"
            };

            _duplicatePerson = new Fielding()
            {
                Pos      = "C",
                YearId   = 1999,
                A        = 18,
                E        = 99,
                PlayerId = "id"
            };

            _database.Add(_firstPerson);
            _database.Add(_secondPerson);
            _database.Add(_duplicatePerson);
            _database.SaveChanges();
        }
コード例 #2
0
        public void CreateFakeData()
        {
            _firstPerson = new PitchingPost()
            {
                YearId   = 2000,
                Hr       = 20,
                W        = 10,
                PlayerId = "id",
                Round    = "WS"
            };

            _secondPerson = new PitchingPost()
            {
                YearId   = 2000,
                Hr       = 10,
                W        = 3,
                PlayerId = "anotherId",
                Round    = "WS"
            };

            _thirdPerson = new PitchingPost()
            {
                YearId   = 1999,
                Hr       = 18,
                W        = 99,
                PlayerId = "id",
                Round    = "WC"
            };

            _fourthPerson = new PitchingPost()
            {
                YearId   = 1998,
                Hr       = 18,
                W        = 20,
                PlayerId = "fourthId",
                Round    = "WC",

                Player = new People()
                {
                    PlayerId  = "fourthId",
                    NameFirst = "first",
                    NameGiven = "first middle",
                    NameLast  = "last"
                }
            };

            _database.Add(_firstPerson);
            _database.Add(_secondPerson);
            _database.Add(_thirdPerson);
            _database.Add(_fourthPerson);
            _database.SaveChanges();
        }
コード例 #3
0
        public void CreateFakeData(BaseballDBContext database)
        {
            _firstPersonPost = new BattingPost()
            {
                YearId   = 2000,
                Hr       = 20,
                Ab       = 100,
                PlayerId = "id",
                Round    = "WC"
            };

            _secondPersonPost = new BattingPost()
            {
                YearId   = 2000,
                Hr       = 10,
                Ab       = 200,
                PlayerId = "anotherId",
                Round    = "WS"
            };

            _thirdPersonPost = new BattingPost()
            {
                YearId   = 1999,
                Hr       = 18,
                Ab       = 99,
                PlayerId = "id",
                Round    = "WC"
            };

            _fourthPersonPost = new BattingPost()
            {
                YearId   = 1998,
                Hr       = 18,
                Ab       = 20,
                PlayerId = "fourthId",
                Round    = "WS",
                Player   = new People()
                {
                    PlayerId  = "fourthId",
                    NameFirst = "first",
                    NameGiven = "first middle",
                    NameLast  = "last"
                }
            };

            _database.Add(_firstPersonPost);
            _database.Add(_secondPersonPost);
            _database.Add(_thirdPersonPost);
            _database.Add(_fourthPersonPost);
            _database.SaveChanges();
        }
コード例 #4
0
        public void CreateFakeData(BaseballDBContext database)
        {
            _firstPerson = new People()
            {
                NameFirst = "first",
                NameLast = "last",
                PlayerId = "id",
                NameGiven = "first middle"
            };

            _secondPerson = new People()
            {
                NameFirst = "anotherFirst",
                NameLast = "antherLast",
                PlayerId = "anotherId",
                NameGiven = "anotherFirst anotherMiddle"
            };

            _database.Add(_firstPerson);
            _database.Add(_secondPerson);
            _database.SaveChanges();
        }
コード例 #5
0
        public void CreateFakeData()
        {
            _firstTeam = new Teams()
            {
                YearId   = 2000,
                Hr       = 20,
                Ab       = 100,
                TeamId   = "SE1",
                FranchId = "SEA",
                LgId     = "AL"
            };

            _secondTeam = new Teams()
            {
                YearId   = 2000,
                Hr       = 10,
                Ab       = 200,
                TeamId   = "AT1",
                FranchId = "ATL",
                LgId     = "NL"
            };

            _thirdTeam = new Teams()
            {
                YearId   = 1999,
                Hr       = 18,
                Ab       = 99,
                TeamId   = "SE1",
                FranchId = "SEA",
                LgId     = "AL"
            };

            _database.Add(_firstTeam);
            _database.Add(_secondTeam);
            _database.Add(_thirdTeam);
            _database.SaveChanges();
        }
コード例 #6
0
        public void CreateFakeData()
        {
            _firstPerson = new Batting()
            {
                YearId   = 2000,
                Hr       = 20,
                Ab       = 100,
                PlayerId = "id",
                TeamId   = "SEA"
            };

            _secondPerson = new Batting()
            {
                YearId   = 2000,
                Hr       = 10,
                Ab       = 200,
                PlayerId = "anotherId",
                TeamId   = "SEA"
            };

            _thirdPerson = new Batting()
            {
                YearId   = 1999,
                Hr       = 18,
                Ab       = 99,
                PlayerId = "id",
                TeamId   = "SEA"
            };

            _fourthPerson = new Batting
            {
                YearId   = 1998,
                Hr       = 18,
                Ab       = 101,
                PlayerId = "fourthId",
                Player   = new People()
                {
                    PlayerId  = "fourthId",
                    NameFirst = "first",
                    NameGiven = "first middle",
                    NameLast  = "last"
                },
                TeamId = "NYA"
            };

            _fifthPerson = new Batting
            {
                YearId   = 1998,
                Hr       = 18,
                Ab       = 101,
                PlayerId = "fifthId",
                Player   = new People()
                {
                    PlayerId  = "fifthId",
                    NameFirst = "fifth",
                    NameGiven = "fifth middle",
                    NameLast  = "last"
                },
                TeamId = "NYA"
            };

            _database.Add(_firstPerson);
            _database.Add(_secondPerson);
            _database.Add(_thirdPerson);
            _database.Add(_fourthPerson);
            _database.SaveChanges();
        }