public IActionResult Register( string firstName, string lastName, string email, string password, string confirmPassword, string phoneNumber, string birthDate, string gender, IFormFile profilePicture) { try { var image = ImageUploadHelper.ImageToBase64(profilePicture); User newUser = Models.User.Register(firstName, lastName, email, password, confirmPassword, phoneNumber, birthDate, gender, image); } catch (Exception ex) { Console.WriteLine(ex.StackTrace); return(BadRequest()); } return(Redirect("/home")); }