With Entity Framework I’m inserting a json string with all quotes escaped.
For example:
"{\"PDFName\":\"Test \",\"PDFDesc\":\"test desc\"}"
Somehow the backslashes are getting removed from my string before the insert and the value in the database is:
"{"PDFName":"Test ","PDFDesc":"test desc"}"
Any ideas?
Sounds like you’re missing one level of “escapes”. I.e. escape your string once more (essentially replacing all the
\with\\; but don’t foget about non-escaped ” as well).Similar things happen in other cases, e.g. when using a string in a SQL statement,