コード例 #1
0
        public void SeedPhoneBooks(TechAssessmentDbContext context)
        {
            var phoneBooks = new[]
            {
                new PhoneBook {
                    Name = "Default"
                }
            };

            context.PhoneBooks.AddRange(phoneBooks);
            context.SaveChanges();
        }
コード例 #2
0
        public void SeedUsers(TechAssessmentDbContext context)
        {
            var users = new[]
            {
                new User {
                    Username = "******", FirstName = "System", LastName = "Administrator"
                },
                new User {
                    Username = "******", FirstName = "Test", LastName = "User"
                }
            };

            context.Users.AddRange(users);
            context.SaveChanges();
        }