Note that there are some explanatory texts on larger screens.

plurals
  1. POSyntax to Format Automatic Properties
    primarykey
    data
    text
    <p>I've got a typical C# automatic property. How can I apply WebUtility.HtmlDecode() when I've only got a get; set;?</p> <p>UPDATE:</p> <p>Ok, dumb mistake of the day. I had a weird issue where my web.config db connection string was pointed to the right server but for some reason since I had 2 instances (one sql 2008 and 2012) it was still picking up the instance of that DB in 2008 which had the encoding still there. I had fixed the encoding issue by just decoding the Title via a unit test I created in the 2012 DB which in this case this whole fing post was unecessary in stack because the ultimate problem was it was reading from the old DB (messing me up).</p> <p>Anyway I had already fixed this, finally got rid of the 2008 copy and now it's reading it fine after my fix:</p> <pre><code> [Test] public void CleanAllPostEntries_DecodeHTML_DecodeWasSuccessful() { // Arrange // Act IEnumerable&lt;Entry&gt; posts = PostCRUD.GetAllPosts(); foreach (Entry post in posts) { post.Title = WebUtility.HtmlDecode(post.Title); post.Body = WebUtility.HtmlDecode(post.Body); post.MetaTitle = WebUtility.HtmlDecode(post.MetaTitle); PostCRUD.UpdatePost(post); //System.Diagnostics.Debug.WriteLine("id: " + post.Id); //System.Diagnostics.Debug.WriteLine("title: " + WebUtility.HtmlDecode(post.Title)); //System.Diagnostics.Debug.WriteLine("body: " + WebUtility.HtmlDecode(post.Body)); } //Assert // TODO: add asserts } </code></pre> <p>So I don't think I need the decode afterall..I already did it!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload