public static void SeedUsers(DataContext2 context) { if (!context.Users.Any()) { var userData = System.IO.File.ReadAllText("Data/UserSeedData.json"); var users = JsonConvert.DeserializeObject <List <User> >(userData); foreach (var user in users) { byte[] passwordHash, passwordSalt; CreatePasswordHash("password", out passwordHash, out passwordSalt); user.PasswordHash = passwordHash; user.PasswordSalt = passwordSalt; user.Username.ToLower(); context.Users.Add(user); } context.SaveChanges(); } }
public AuthService(DataContext2 context) { _context = context; }
public DatingRepository(DataContext2 context) { _context = context; }