Ejemplo n.º 1
0
        public static void Initialize(IServiceProvider serviceProvider)
        {
            using (var context = new HemsidaContext(
                       serviceProvider.GetRequiredService <
                           DbContextOptions <HemsidaContext> >()))
            {
                // Look for any movies.
                if (context.Login.Any())
                {
                    return;   // DB has been seeded
                }

                context.Login.AddRange(
                    new Login
                {
                    UserName = "******",
                    PassWord = "******"
                }
                    );
                context.SaveChanges();
            }
        }
Ejemplo n.º 2
0
 public LoginsController(HemsidaContext context)
 {
     _context = context;
 }