C
C#3w ago
ardi

Database adding letters to my output why?

public User GetUserByUsername(string username) { var usr = _context.Users.SingleOrDefault(x => x.Username == username); Debug.WriteLine(usr.PasswordHash); return usr; } The Debug write has this output: $2a$12$3JIbqxqlKHEDJrXrUOUthursGxwFsidNVFkEvuDBqns1ThlNJlU9u when i debug the object it shows me this: "$2a$12$3JIbqxqlKHEDJrXrUOUthursGxwFsidNVFkEvuDBqns1ThlNJlU9u\r\n" i am using EF core and sql server for that... why is that what is happening here?
No description
5 Replies
greyfox
greyfox3w ago
Debug.WriteLine is adding a carriage return to the output. Use Debug.Write instead.
ardi
ardiOP3w ago
its about the database output the debug writeline shows the exact value stored in the databasse..
greyfox
greyfox3w ago
my misunderstanding
surf68
surf683w ago
and you've confirmed that the carriage return and line feed are not in the database?
greyfox
greyfox3w ago
where are you saving the password hash? yeah, that's what I'm thinking
Want results from more Discord servers?
Add your server