Example #1
0
        public static void Initialize(StaffAppContext context)
        {
            context.Database.EnsureCreated();

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

            var staff = new StaffEntity[]
            {
                new StaffEntity {
                    Firstname = "Carson", Lastname = "Alexander", Email = "*****@*****.**"
                },
                new StaffEntity {
                    Firstname = "Per", Lastname = "Jensen", Email = "*****@*****.**"
                },
                new StaffEntity {
                    Firstname = "Hans", Lastname = "Hansen", Email = "*****@*****.**"
                },
            };

            foreach (StaffEntity s in staff)
            {
                context.StaffEntities.Add(s);
            }
            context.SaveChanges();
        }
 public TicketsController(StaffAppContext context)
 {
     _context = context;
 }
Example #3
0
 public StaffController(StaffAppContext context)
 {
     _context = context;
 }