While returning Json
Response from .NET Core 6 Web APIs, I want to encode all strings with WebUtility.HtmlEncode
. As of now, I am writing this line for each string and I just came across this link: https://stackoverflow.com/a/44117929/3234665.
Is there anyway we can declare this at some central/ global level (i.e. Attribute, Program.cs etc?) to reduce repetitive lines everywhere?