Esempio n. 1
0
        public void Seed()
        {
            var initialActionLinks = new List <Users>
            {
                new Users
                {
                    Name     = "admin",
                    Account  = "admin",
                    Password = "******"
                }
            };

            foreach (var action in initialActionLinks)
            {
                if (_context.Users.Any(r => r.Name == action.Name))
                {
                    continue;
                }
                _context.Users.Add(action);
            }
            _context.SaveChanges();
        }
Esempio n. 2
0
        public void Seed()
        {
            var initialActionLinks = new List <ActionLinks>
            {
                new ActionLinks
                {
                    Id         = 1,
                    Name       = "主页",
                    Contorller = "Home",
                    Action     = "Index"
                }
            };

            foreach (var action in initialActionLinks)
            {
                if (_context.ActionLinks.Any(r => r.Name == action.Name))
                {
                    continue;
                }
                _context.ActionLinks.Add(action);
            }
            _context.SaveChanges();
        }