public static void SeedDB(StairsAppContext ctx)
        {
            string password = "******";

            byte[] passwordHash, passwordSalt;
            CreatePasswordHash(password, out passwordHash, out passwordSalt);


            User userMichal = new User
            {
                Username     = "******",
                PasswordHash = passwordHash,
                PasswordSalt = passwordSalt,
                IsAdmin      = true
            };

            ctx.Users.Add(userMichal);
            ctx.SaveChanges();
        }
Beispiel #2
0
 public UserRepository(StairsAppContext ctx)
 {
     _ctx = ctx;
 }
Beispiel #3
0
 public ProductRepository(StairsAppContext sac)
 {
     _stairsAppContext = sac;
 }