public static void SeedUser(NewProjectAPIContext context) { if (!context.Users.Any()) { var userData = System.IO.File.ReadAllText("Repo/UserSeedData.json"); var users = JsonConvert.DeserializeObject <List <Users> >(userData); foreach (var user in users) { byte[] passwordhash, passwordSalt; CreatePasswordHash("password", out passwordhash, out passwordSalt); user.HashPassword = passwordhash; user.PasswordSalt = passwordSalt; user.Username = user.Username.ToLower(); context.Add(user); } context.SaveChanges(); } }
public DatingRepo(NewProjectAPIContext context) { _context = context; }
public NewsController(NewProjectAPIContext context) { _context = context; }
public AuthRepo(NewProjectAPIContext context) { _context = context; }
public UsersController(IDatingRepo repo, IMapper mapper, NewProjectAPIContext context) { _repo = repo; _mapper = mapper; _context = context; }
public MyJobRepocs(NewProjectAPIContext context) { _context = context; }
public PropertiesController(NewProjectAPIContext context) { _context = context; }
public PropertiesController(NewProjectAPIContext context, IMapper mapper) { _context = context; _mapper = mapper; }