storing passwords in sql server database using ef core code first
问题 I have this class to represent my users: public class User { public int ID {get; set;} public string UserName {get; set;} [DataType(DataType.Password)] public string Password {get; set;} } A simplistic version of my register method looks like this: [HttpPost] Register(User newUser) { ... _context.add(newUser); await _context.SaveChangesAsync(); ... } So my question is: Should I alter the password type from a regular string before storing? If so, to what data type? 回答1: YES YES YES Never store