コード例 #1
0
        public static void Initialize(EmployeeProfileDbContext context)
        {
            // Look for any movies.
            if (context.EmployeeProfiles.Any())
            {
                return;   // DB has been seeded
            }

            context.EmployeeProfiles.AddRange(
                new EmployeeProfile
            {
                FirstName  = "Armen",
                LastName   = "Romo",
                Title      = "Software Engineer",
                Department = "Engineering"
            },

                new EmployeeProfile
            {
                FirstName  = "Corinne",
                LastName   = "Horn",
                Title      = "Business Analyst",
                Department = "Human Resources"
            },

                new EmployeeProfile
            {
                FirstName  = "Dan",
                LastName   = "Drayton",
                Title      = "System Administrator",
                Department = "IT"
            },

                new EmployeeProfile
            {
                FirstName  = "Joann",
                LastName   = "Chambers",
                Title      = "Senior Accoutant",
                Department = "Finance"
            }
                );
            context.SaveChanges();
        }
コード例 #2
0
 public EmployeeProfileRepository(EmployeeProfileDbContext context) : base(context)
 {
     _context = context;
 }