Where is the best place to sanitize? I was thinking about doing the following but someone may have a better idea
public class myObject
{
[Required]
public string SomeTextField {get; set;}
public string SomeTextFieldSanitized
{
get { return Sanitizer.GetSafeHtmlFragment(SomeTextField); }
}
[Required]
public string SomeOtherTextField {get; set;}
public string SomeOtherTextFieldSanitized
{
get { return Sanitizer.GetSafeHtmlFragment(SomeOtherTextField); }
}
}This way, I can just work with properties that have the "Sanitized" in their names.
Is there a better way to handle this?