[{"data":1,"prerenderedAt":3188},["ShallowReactive",2],{"blog:2010:creating-rss-feeds-in-asp-net-mvc":3,"blogMore-Development":1716,"comments-creating-rss-feeds-in-asp-net-mvc":1729},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"category":11,"tags":12,"excerpt":16,"body":31,"_type":1708,"_id":1709,"_source":1710,"_file":1711,"_stem":1712,"_extension":1713,"url":1714,"wordCount":1715,"minutes":226,"commentCount":276},"/blog/2010/creating-rss-feeds-in-asp-net-mvc","2010",false,"en","Creating RSS feeds in ASP.NET MVC","ASP.NET MVC is the technology that brought me to Microsoft and the west-coast and it’s been fun getting to grips with it these last few weeks.","2010-04-26T08:45:48+00:00","Development",[13,14,15],".NET","ASP.NET","RSS",{"type":17,"children":18},"root",[19,26],{"type":20,"tag":21,"props":22,"children":23},"element","p",{},[24],{"type":25,"value":9},"text",{"type":20,"tag":21,"props":27,"children":28},{},[29],{"type":25,"value":30},"Last week I needed to expose RSS feeds and checked out some examples online but was very disappointed.",{"type":17,"children":32,"toc":1706},[33,37,41,46,51,107,112,149,154,1132,1169,1636,1641,1692,1700],{"type":20,"tag":21,"props":34,"children":35},{},[36],{"type":25,"value":9},{"type":20,"tag":21,"props":38,"children":39},{},[40],{"type":25,"value":30},{"type":20,"tag":21,"props":42,"children":43},{},[44],{"type":25,"value":45},"If you find yourself contemplating writing code to solve technical problems rather than the specific business domain you work in you owe it to your employer and fellow developers to see what exists before churning out code to solve it.",{"type":20,"tag":21,"props":47,"children":48},{},[49],{"type":25,"value":50},"The primary excuse (and I admit to using it myself) is “X is too bloated, I only need a subset. I can write that quicker than learn their solution.” but a quick reality check:",{"type":20,"tag":52,"props":53,"children":54},"ul",{},[55,67,77,87,97],{"type":20,"tag":56,"props":57,"children":58},"li",{},[59,65],{"type":20,"tag":60,"props":61,"children":62},"em",{},[63],{"type":25,"value":64},"Time",{"type":25,"value":66},": code always takes longer than you think",{"type":20,"tag":56,"props":68,"children":69},{},[70,75],{"type":20,"tag":60,"props":71,"children":72},{},[73],{"type":25,"value":74},"Bloat",{"type":25,"value":76},": indicates the problem is more complex than you realize",{"type":20,"tag":56,"props":78,"children":79},{},[80,85],{"type":20,"tag":60,"props":81,"children":82},{},[83],{"type":25,"value":84},"Growth",{"type":25,"value":86},": todays requirements will grow tomorrow",{"type":20,"tag":56,"props":88,"children":89},{},[90,95],{"type":20,"tag":60,"props":91,"children":92},{},[93],{"type":25,"value":94},"Maintenance",{"type":25,"value":96},": fixing code outside your business domain",{"type":20,"tag":56,"props":98,"children":99},{},[100,105],{"type":20,"tag":60,"props":101,"children":102},{},[103],{"type":25,"value":104},"Isolation",{"type":25,"value":106},": nobody coming in will know your home-grown solution",{"type":20,"tag":21,"props":108,"children":109},{},[110],{"type":25,"value":111},"The RSS examples I found had their own ‘feed’ and ‘items’ classes and implemented flaky XML rendering by themselves or as MVC view pages.",{"type":20,"tag":21,"props":113,"children":114},{},[115,117,124,126,132,134,140,141,147],{"type":25,"value":116},"If these people had spent a little time doing some research they would have discovered .NET’s built ",{"type":20,"tag":118,"props":119,"children":121},"code",{"className":120},[],[122],{"type":25,"value":123},"in SyndicatedFeed",{"type":25,"value":125}," and ",{"type":20,"tag":118,"props":127,"children":129},{"className":128},[],[130],{"type":25,"value":131},"SyndicatedItem",{"type":25,"value":133}," class for content and two classes (",{"type":20,"tag":118,"props":135,"children":137},{"className":136},[],[138],{"type":25,"value":139},"Rss20FeedFormatter",{"type":25,"value":125},{"type":20,"tag":118,"props":142,"children":144},{"className":143},[],[145],{"type":25,"value":146},"Atom10FeedFormatter",{"type":25,"value":148}," )  to handle XML generation with correct encoding, formatting and optional fields.",{"type":20,"tag":21,"props":150,"children":151},{},[152],{"type":25,"value":153},"All that is actually required is a small class to wire up these built-in classes to MVC.",{"type":20,"tag":155,"props":156,"children":161},"pre",{"className":157,"code":158,"language":159,"meta":160,"style":160},"language-csharp shiki shiki-themes everforest-light dracula","using System;\nusing System.ServiceModel.Syndication;\nusing System.Text;\nusing System.Web;\nusing System.Web.Mvc;\nusing System.Xml;\n\nnamespace MyApplication.Something\n{\n  public class FeedResult : ActionResult {\n    public Encoding ContentEncoding { get; set; }\n    public string ContentType { get; set; }\n\n    private readonly SyndicationFeedFormatter feed;\n    public SyndicationFeedFormatter Feed{\n      get { return feed; }\n    }\n\n    public FeedResult(SyndicationFeedFormatter feed) {\n      this.feed = feed;\n    }\n\n    public override void ExecuteResult(ControllerContext context) {\n      if (context == null)\n        throw new ArgumentNullException(\"context\");\n\n      var response = context.HttpContext.Response;\n      response.ContentType = !string.IsNullOrEmpty(ContentType) ? ContentType : \"application/rss+xml\";\n\n      if (ContentEncoding != null)\n        response.ContentEncoding = ContentEncoding;\n\n      if (feed != null) {\n        using (var xmlWriter = new XmlTextWriter(response.Output)) {\n          xmlWriter.Formatting = Formatting.Indented;\n          feed.WriteTo(xmlWriter);\n        }\n      }\n    }\n  }\n}\n","csharp","",[162],{"type":20,"tag":118,"props":163,"children":164},{"__ignoreMap":160},[165,189,224,249,274,307,332,342,366,375,412,452,486,494,518,535,559,568,576,610,639,647,655,696,726,770,778,820,895,903,929,952,960,985,1037,1069,1088,1097,1106,1114,1123],{"type":20,"tag":166,"props":167,"children":170},"span",{"class":168,"line":169},"line",1,[171,177,183],{"type":20,"tag":166,"props":172,"children":174},{"style":173},"--shiki-default:#F85552;--shiki-dark:#FF79C6",[175],{"type":25,"value":176},"using",{"type":20,"tag":166,"props":178,"children":180},{"style":179},"--shiki-default:#DF69BA;--shiki-default-font-style:inherit;--shiki-dark:#8BE9FD;--shiki-dark-font-style:italic",[181],{"type":25,"value":182}," System",{"type":20,"tag":166,"props":184,"children":186},{"style":185},"--shiki-default:#5C6A72;--shiki-dark:#F8F8F2",[187],{"type":25,"value":188},";\n",{"type":20,"tag":166,"props":190,"children":192},{"class":168,"line":191},2,[193,197,201,206,211,215,220],{"type":20,"tag":166,"props":194,"children":195},{"style":173},[196],{"type":25,"value":176},{"type":20,"tag":166,"props":198,"children":199},{"style":179},[200],{"type":25,"value":182},{"type":20,"tag":166,"props":202,"children":203},{"style":185},[204],{"type":25,"value":205},".",{"type":20,"tag":166,"props":207,"children":208},{"style":179},[209],{"type":25,"value":210},"ServiceModel",{"type":20,"tag":166,"props":212,"children":213},{"style":185},[214],{"type":25,"value":205},{"type":20,"tag":166,"props":216,"children":217},{"style":179},[218],{"type":25,"value":219},"Syndication",{"type":20,"tag":166,"props":221,"children":222},{"style":185},[223],{"type":25,"value":188},{"type":20,"tag":166,"props":225,"children":227},{"class":168,"line":226},3,[228,232,236,240,245],{"type":20,"tag":166,"props":229,"children":230},{"style":173},[231],{"type":25,"value":176},{"type":20,"tag":166,"props":233,"children":234},{"style":179},[235],{"type":25,"value":182},{"type":20,"tag":166,"props":237,"children":238},{"style":185},[239],{"type":25,"value":205},{"type":20,"tag":166,"props":241,"children":242},{"style":179},[243],{"type":25,"value":244},"Text",{"type":20,"tag":166,"props":246,"children":247},{"style":185},[248],{"type":25,"value":188},{"type":20,"tag":166,"props":250,"children":252},{"class":168,"line":251},4,[253,257,261,265,270],{"type":20,"tag":166,"props":254,"children":255},{"style":173},[256],{"type":25,"value":176},{"type":20,"tag":166,"props":258,"children":259},{"style":179},[260],{"type":25,"value":182},{"type":20,"tag":166,"props":262,"children":263},{"style":185},[264],{"type":25,"value":205},{"type":20,"tag":166,"props":266,"children":267},{"style":179},[268],{"type":25,"value":269},"Web",{"type":20,"tag":166,"props":271,"children":272},{"style":185},[273],{"type":25,"value":188},{"type":20,"tag":166,"props":275,"children":277},{"class":168,"line":276},5,[278,282,286,290,294,298,303],{"type":20,"tag":166,"props":279,"children":280},{"style":173},[281],{"type":25,"value":176},{"type":20,"tag":166,"props":283,"children":284},{"style":179},[285],{"type":25,"value":182},{"type":20,"tag":166,"props":287,"children":288},{"style":185},[289],{"type":25,"value":205},{"type":20,"tag":166,"props":291,"children":292},{"style":179},[293],{"type":25,"value":269},{"type":20,"tag":166,"props":295,"children":296},{"style":185},[297],{"type":25,"value":205},{"type":20,"tag":166,"props":299,"children":300},{"style":179},[301],{"type":25,"value":302},"Mvc",{"type":20,"tag":166,"props":304,"children":305},{"style":185},[306],{"type":25,"value":188},{"type":20,"tag":166,"props":308,"children":310},{"class":168,"line":309},6,[311,315,319,323,328],{"type":20,"tag":166,"props":312,"children":313},{"style":173},[314],{"type":25,"value":176},{"type":20,"tag":166,"props":316,"children":317},{"style":179},[318],{"type":25,"value":182},{"type":20,"tag":166,"props":320,"children":321},{"style":185},[322],{"type":25,"value":205},{"type":20,"tag":166,"props":324,"children":325},{"style":179},[326],{"type":25,"value":327},"Xml",{"type":20,"tag":166,"props":329,"children":330},{"style":185},[331],{"type":25,"value":188},{"type":20,"tag":166,"props":333,"children":335},{"class":168,"line":334},7,[336],{"type":20,"tag":166,"props":337,"children":339},{"emptyLinePlaceholder":338},true,[340],{"type":25,"value":341},"\n",{"type":20,"tag":166,"props":343,"children":345},{"class":168,"line":344},8,[346,352,357,361],{"type":20,"tag":166,"props":347,"children":349},{"style":348},"--shiki-default:#35A77C;--shiki-dark:#FF79C6",[350],{"type":25,"value":351},"namespace",{"type":20,"tag":166,"props":353,"children":354},{"style":179},[355],{"type":25,"value":356}," MyApplication",{"type":20,"tag":166,"props":358,"children":359},{"style":185},[360],{"type":25,"value":205},{"type":20,"tag":166,"props":362,"children":363},{"style":179},[364],{"type":25,"value":365},"Something\n",{"type":20,"tag":166,"props":367,"children":369},{"class":168,"line":368},9,[370],{"type":20,"tag":166,"props":371,"children":372},{"style":185},[373],{"type":25,"value":374},"{\n",{"type":20,"tag":166,"props":376,"children":378},{"class":168,"line":377},10,[379,385,390,396,401,407],{"type":20,"tag":166,"props":380,"children":382},{"style":381},"--shiki-default:#F57D26;--shiki-dark:#FF79C6",[383],{"type":25,"value":384},"  public",{"type":20,"tag":166,"props":386,"children":387},{"style":173},[388],{"type":25,"value":389}," class",{"type":20,"tag":166,"props":391,"children":393},{"style":392},"--shiki-default:#3A94C5;--shiki-dark:#8BE9FD",[394],{"type":25,"value":395}," FeedResult",{"type":20,"tag":166,"props":397,"children":398},{"style":185},[399],{"type":25,"value":400}," : ",{"type":20,"tag":166,"props":402,"children":404},{"style":403},"--shiki-default:#3A94C5;--shiki-default-font-style:inherit;--shiki-dark:#8BE9FD;--shiki-dark-font-style:italic",[405],{"type":25,"value":406},"ActionResult",{"type":20,"tag":166,"props":408,"children":409},{"style":185},[410],{"type":25,"value":411}," {\n",{"type":20,"tag":166,"props":413,"children":415},{"class":168,"line":414},11,[416,421,426,431,437,442,447],{"type":20,"tag":166,"props":417,"children":418},{"style":381},[419],{"type":25,"value":420},"    public",{"type":20,"tag":166,"props":422,"children":423},{"style":403},[424],{"type":25,"value":425}," Encoding",{"type":20,"tag":166,"props":427,"children":428},{"style":185},[429],{"type":25,"value":430}," ContentEncoding { ",{"type":20,"tag":166,"props":432,"children":434},{"style":433},"--shiki-default:#3A94C5;--shiki-dark:#FF79C6",[435],{"type":25,"value":436},"get",{"type":20,"tag":166,"props":438,"children":439},{"style":185},[440],{"type":25,"value":441},"; ",{"type":20,"tag":166,"props":443,"children":444},{"style":433},[445],{"type":25,"value":446},"set",{"type":20,"tag":166,"props":448,"children":449},{"style":185},[450],{"type":25,"value":451},"; }\n",{"type":20,"tag":166,"props":453,"children":455},{"class":168,"line":454},12,[456,460,465,470,474,478,482],{"type":20,"tag":166,"props":457,"children":458},{"style":381},[459],{"type":25,"value":420},{"type":20,"tag":166,"props":461,"children":462},{"style":433},[463],{"type":25,"value":464}," string",{"type":20,"tag":166,"props":466,"children":467},{"style":185},[468],{"type":25,"value":469}," ContentType { ",{"type":20,"tag":166,"props":471,"children":472},{"style":433},[473],{"type":25,"value":436},{"type":20,"tag":166,"props":475,"children":476},{"style":185},[477],{"type":25,"value":441},{"type":20,"tag":166,"props":479,"children":480},{"style":433},[481],{"type":25,"value":446},{"type":20,"tag":166,"props":483,"children":484},{"style":185},[485],{"type":25,"value":451},{"type":20,"tag":166,"props":487,"children":489},{"class":168,"line":488},13,[490],{"type":20,"tag":166,"props":491,"children":492},{"emptyLinePlaceholder":338},[493],{"type":25,"value":341},{"type":20,"tag":166,"props":495,"children":497},{"class":168,"line":496},14,[498,503,508,513],{"type":20,"tag":166,"props":499,"children":500},{"style":381},[501],{"type":25,"value":502},"    private",{"type":20,"tag":166,"props":504,"children":505},{"style":381},[506],{"type":25,"value":507}," readonly",{"type":20,"tag":166,"props":509,"children":510},{"style":403},[511],{"type":25,"value":512}," SyndicationFeedFormatter",{"type":20,"tag":166,"props":514,"children":515},{"style":185},[516],{"type":25,"value":517}," feed;\n",{"type":20,"tag":166,"props":519,"children":521},{"class":168,"line":520},15,[522,526,530],{"type":20,"tag":166,"props":523,"children":524},{"style":381},[525],{"type":25,"value":420},{"type":20,"tag":166,"props":527,"children":528},{"style":403},[529],{"type":25,"value":512},{"type":20,"tag":166,"props":531,"children":532},{"style":185},[533],{"type":25,"value":534}," Feed{\n",{"type":20,"tag":166,"props":536,"children":538},{"class":168,"line":537},16,[539,544,549,554],{"type":20,"tag":166,"props":540,"children":541},{"style":433},[542],{"type":25,"value":543},"      get",{"type":20,"tag":166,"props":545,"children":546},{"style":185},[547],{"type":25,"value":548}," { ",{"type":20,"tag":166,"props":550,"children":551},{"style":173},[552],{"type":25,"value":553},"return",{"type":20,"tag":166,"props":555,"children":556},{"style":185},[557],{"type":25,"value":558}," feed; }\n",{"type":20,"tag":166,"props":560,"children":562},{"class":168,"line":561},17,[563],{"type":20,"tag":166,"props":564,"children":565},{"style":185},[566],{"type":25,"value":567},"    }\n",{"type":20,"tag":166,"props":569,"children":571},{"class":168,"line":570},18,[572],{"type":20,"tag":166,"props":573,"children":574},{"emptyLinePlaceholder":338},[575],{"type":25,"value":341},{"type":20,"tag":166,"props":577,"children":579},{"class":168,"line":578},19,[580,584,589,594,599,605],{"type":20,"tag":166,"props":581,"children":582},{"style":381},[583],{"type":25,"value":420},{"type":20,"tag":166,"props":585,"children":587},{"style":586},"--shiki-default:#8DA101;--shiki-dark:#50FA7B",[588],{"type":25,"value":395},{"type":20,"tag":166,"props":590,"children":591},{"style":185},[592],{"type":25,"value":593},"(",{"type":20,"tag":166,"props":595,"children":596},{"style":403},[597],{"type":25,"value":598},"SyndicationFeedFormatter",{"type":20,"tag":166,"props":600,"children":602},{"style":601},"--shiki-default:#5C6A72;--shiki-default-font-style:inherit;--shiki-dark:#FFB86C;--shiki-dark-font-style:italic",[603],{"type":25,"value":604}," feed",{"type":20,"tag":166,"props":606,"children":607},{"style":185},[608],{"type":25,"value":609},") {\n",{"type":20,"tag":166,"props":611,"children":613},{"class":168,"line":612},20,[614,620,624,630,635],{"type":20,"tag":166,"props":615,"children":617},{"style":616},"--shiki-default:#DF69BA;--shiki-default-font-style:inherit;--shiki-dark:#BD93F9;--shiki-dark-font-style:italic",[618],{"type":25,"value":619},"      this",{"type":20,"tag":166,"props":621,"children":622},{"style":185},[623],{"type":25,"value":205},{"type":20,"tag":166,"props":625,"children":627},{"style":626},"--shiki-default:#35A77C;--shiki-dark:#F8F8F2",[628],{"type":25,"value":629},"feed",{"type":20,"tag":166,"props":631,"children":632},{"style":381},[633],{"type":25,"value":634}," =",{"type":20,"tag":166,"props":636,"children":637},{"style":185},[638],{"type":25,"value":517},{"type":20,"tag":166,"props":640,"children":642},{"class":168,"line":641},21,[643],{"type":20,"tag":166,"props":644,"children":645},{"style":185},[646],{"type":25,"value":567},{"type":20,"tag":166,"props":648,"children":650},{"class":168,"line":649},22,[651],{"type":20,"tag":166,"props":652,"children":653},{"emptyLinePlaceholder":338},[654],{"type":25,"value":341},{"type":20,"tag":166,"props":656,"children":658},{"class":168,"line":657},23,[659,663,668,673,678,682,687,692],{"type":20,"tag":166,"props":660,"children":661},{"style":381},[662],{"type":25,"value":420},{"type":20,"tag":166,"props":664,"children":665},{"style":381},[666],{"type":25,"value":667}," override",{"type":20,"tag":166,"props":669,"children":670},{"style":433},[671],{"type":25,"value":672}," void",{"type":20,"tag":166,"props":674,"children":675},{"style":586},[676],{"type":25,"value":677}," ExecuteResult",{"type":20,"tag":166,"props":679,"children":680},{"style":185},[681],{"type":25,"value":593},{"type":20,"tag":166,"props":683,"children":684},{"style":403},[685],{"type":25,"value":686},"ControllerContext",{"type":20,"tag":166,"props":688,"children":689},{"style":601},[690],{"type":25,"value":691}," context",{"type":20,"tag":166,"props":693,"children":694},{"style":185},[695],{"type":25,"value":609},{"type":20,"tag":166,"props":697,"children":699},{"class":168,"line":698},24,[700,705,710,715,721],{"type":20,"tag":166,"props":701,"children":702},{"style":173},[703],{"type":25,"value":704},"      if",{"type":20,"tag":166,"props":706,"children":707},{"style":185},[708],{"type":25,"value":709}," (context ",{"type":20,"tag":166,"props":711,"children":712},{"style":381},[713],{"type":25,"value":714},"==",{"type":20,"tag":166,"props":716,"children":718},{"style":717},"--shiki-default:#DF69BA;--shiki-dark:#BD93F9",[719],{"type":25,"value":720}," null",{"type":20,"tag":166,"props":722,"children":723},{"style":185},[724],{"type":25,"value":725},")\n",{"type":20,"tag":166,"props":727,"children":729},{"class":168,"line":728},25,[730,735,740,745,749,755,761,765],{"type":20,"tag":166,"props":731,"children":732},{"style":173},[733],{"type":25,"value":734},"        throw",{"type":20,"tag":166,"props":736,"children":737},{"style":173},[738],{"type":25,"value":739}," new",{"type":20,"tag":166,"props":741,"children":742},{"style":403},[743],{"type":25,"value":744}," ArgumentNullException",{"type":20,"tag":166,"props":746,"children":747},{"style":185},[748],{"type":25,"value":593},{"type":20,"tag":166,"props":750,"children":752},{"style":751},"--shiki-default:#8DA101;--shiki-dark:#E9F284",[753],{"type":25,"value":754},"\"",{"type":20,"tag":166,"props":756,"children":758},{"style":757},"--shiki-default:#8DA101;--shiki-dark:#F1FA8C",[759],{"type":25,"value":760},"context",{"type":20,"tag":166,"props":762,"children":763},{"style":751},[764],{"type":25,"value":754},{"type":20,"tag":166,"props":766,"children":767},{"style":185},[768],{"type":25,"value":769},");\n",{"type":20,"tag":166,"props":771,"children":773},{"class":168,"line":772},26,[774],{"type":20,"tag":166,"props":775,"children":776},{"emptyLinePlaceholder":338},[777],{"type":25,"value":341},{"type":20,"tag":166,"props":779,"children":781},{"class":168,"line":780},27,[782,787,792,797,802,807,811,816],{"type":20,"tag":166,"props":783,"children":784},{"style":433},[785],{"type":25,"value":786},"      var",{"type":20,"tag":166,"props":788,"children":789},{"style":185},[790],{"type":25,"value":791}," response ",{"type":20,"tag":166,"props":793,"children":794},{"style":381},[795],{"type":25,"value":796},"=",{"type":20,"tag":166,"props":798,"children":799},{"style":185},[800],{"type":25,"value":801}," context.",{"type":20,"tag":166,"props":803,"children":804},{"style":626},[805],{"type":25,"value":806},"HttpContext",{"type":20,"tag":166,"props":808,"children":809},{"style":185},[810],{"type":25,"value":205},{"type":20,"tag":166,"props":812,"children":813},{"style":626},[814],{"type":25,"value":815},"Response",{"type":20,"tag":166,"props":817,"children":818},{"style":185},[819],{"type":25,"value":188},{"type":20,"tag":166,"props":821,"children":823},{"class":168,"line":822},28,[824,829,834,838,843,848,852,857,862,867,872,877,882,887,891],{"type":20,"tag":166,"props":825,"children":826},{"style":185},[827],{"type":25,"value":828},"      response.",{"type":20,"tag":166,"props":830,"children":831},{"style":626},[832],{"type":25,"value":833},"ContentType",{"type":20,"tag":166,"props":835,"children":836},{"style":381},[837],{"type":25,"value":634},{"type":20,"tag":166,"props":839,"children":840},{"style":381},[841],{"type":25,"value":842}," !",{"type":20,"tag":166,"props":844,"children":845},{"style":433},[846],{"type":25,"value":847},"string",{"type":20,"tag":166,"props":849,"children":850},{"style":185},[851],{"type":25,"value":205},{"type":20,"tag":166,"props":853,"children":854},{"style":586},[855],{"type":25,"value":856},"IsNullOrEmpty",{"type":20,"tag":166,"props":858,"children":859},{"style":185},[860],{"type":25,"value":861},"(ContentType) ",{"type":20,"tag":166,"props":863,"children":864},{"style":381},[865],{"type":25,"value":866},"?",{"type":20,"tag":166,"props":868,"children":869},{"style":185},[870],{"type":25,"value":871}," ContentType ",{"type":20,"tag":166,"props":873,"children":874},{"style":381},[875],{"type":25,"value":876},":",{"type":20,"tag":166,"props":878,"children":879},{"style":751},[880],{"type":25,"value":881}," \"",{"type":20,"tag":166,"props":883,"children":884},{"style":757},[885],{"type":25,"value":886},"application/rss+xml",{"type":20,"tag":166,"props":888,"children":889},{"style":751},[890],{"type":25,"value":754},{"type":20,"tag":166,"props":892,"children":893},{"style":185},[894],{"type":25,"value":188},{"type":20,"tag":166,"props":896,"children":898},{"class":168,"line":897},29,[899],{"type":20,"tag":166,"props":900,"children":901},{"emptyLinePlaceholder":338},[902],{"type":25,"value":341},{"type":20,"tag":166,"props":904,"children":906},{"class":168,"line":905},30,[907,911,916,921,925],{"type":20,"tag":166,"props":908,"children":909},{"style":173},[910],{"type":25,"value":704},{"type":20,"tag":166,"props":912,"children":913},{"style":185},[914],{"type":25,"value":915}," (ContentEncoding ",{"type":20,"tag":166,"props":917,"children":918},{"style":381},[919],{"type":25,"value":920},"!=",{"type":20,"tag":166,"props":922,"children":923},{"style":717},[924],{"type":25,"value":720},{"type":20,"tag":166,"props":926,"children":927},{"style":185},[928],{"type":25,"value":725},{"type":20,"tag":166,"props":930,"children":932},{"class":168,"line":931},31,[933,938,943,947],{"type":20,"tag":166,"props":934,"children":935},{"style":185},[936],{"type":25,"value":937},"        response.",{"type":20,"tag":166,"props":939,"children":940},{"style":626},[941],{"type":25,"value":942},"ContentEncoding",{"type":20,"tag":166,"props":944,"children":945},{"style":381},[946],{"type":25,"value":634},{"type":20,"tag":166,"props":948,"children":949},{"style":185},[950],{"type":25,"value":951}," ContentEncoding;\n",{"type":20,"tag":166,"props":953,"children":955},{"class":168,"line":954},32,[956],{"type":20,"tag":166,"props":957,"children":958},{"emptyLinePlaceholder":338},[959],{"type":25,"value":341},{"type":20,"tag":166,"props":961,"children":963},{"class":168,"line":962},33,[964,968,973,977,981],{"type":20,"tag":166,"props":965,"children":966},{"style":173},[967],{"type":25,"value":704},{"type":20,"tag":166,"props":969,"children":970},{"style":185},[971],{"type":25,"value":972}," (feed ",{"type":20,"tag":166,"props":974,"children":975},{"style":381},[976],{"type":25,"value":920},{"type":20,"tag":166,"props":978,"children":979},{"style":717},[980],{"type":25,"value":720},{"type":20,"tag":166,"props":982,"children":983},{"style":185},[984],{"type":25,"value":609},{"type":20,"tag":166,"props":986,"children":988},{"class":168,"line":987},34,[989,994,999,1004,1009,1013,1017,1022,1027,1032],{"type":20,"tag":166,"props":990,"children":991},{"style":173},[992],{"type":25,"value":993},"        using",{"type":20,"tag":166,"props":995,"children":996},{"style":185},[997],{"type":25,"value":998}," (",{"type":20,"tag":166,"props":1000,"children":1001},{"style":433},[1002],{"type":25,"value":1003},"var",{"type":20,"tag":166,"props":1005,"children":1006},{"style":185},[1007],{"type":25,"value":1008}," xmlWriter ",{"type":20,"tag":166,"props":1010,"children":1011},{"style":381},[1012],{"type":25,"value":796},{"type":20,"tag":166,"props":1014,"children":1015},{"style":173},[1016],{"type":25,"value":739},{"type":20,"tag":166,"props":1018,"children":1019},{"style":403},[1020],{"type":25,"value":1021}," XmlTextWriter",{"type":20,"tag":166,"props":1023,"children":1024},{"style":185},[1025],{"type":25,"value":1026},"(response.",{"type":20,"tag":166,"props":1028,"children":1029},{"style":626},[1030],{"type":25,"value":1031},"Output",{"type":20,"tag":166,"props":1033,"children":1034},{"style":185},[1035],{"type":25,"value":1036},")) {\n",{"type":20,"tag":166,"props":1038,"children":1040},{"class":168,"line":1039},35,[1041,1046,1051,1055,1060,1065],{"type":20,"tag":166,"props":1042,"children":1043},{"style":185},[1044],{"type":25,"value":1045},"          xmlWriter.",{"type":20,"tag":166,"props":1047,"children":1048},{"style":626},[1049],{"type":25,"value":1050},"Formatting",{"type":20,"tag":166,"props":1052,"children":1053},{"style":381},[1054],{"type":25,"value":634},{"type":20,"tag":166,"props":1056,"children":1057},{"style":185},[1058],{"type":25,"value":1059}," Formatting.",{"type":20,"tag":166,"props":1061,"children":1062},{"style":626},[1063],{"type":25,"value":1064},"Indented",{"type":20,"tag":166,"props":1066,"children":1067},{"style":185},[1068],{"type":25,"value":188},{"type":20,"tag":166,"props":1070,"children":1072},{"class":168,"line":1071},36,[1073,1078,1083],{"type":20,"tag":166,"props":1074,"children":1075},{"style":185},[1076],{"type":25,"value":1077},"          feed.",{"type":20,"tag":166,"props":1079,"children":1080},{"style":586},[1081],{"type":25,"value":1082},"WriteTo",{"type":20,"tag":166,"props":1084,"children":1085},{"style":185},[1086],{"type":25,"value":1087},"(xmlWriter);\n",{"type":20,"tag":166,"props":1089,"children":1091},{"class":168,"line":1090},37,[1092],{"type":20,"tag":166,"props":1093,"children":1094},{"style":185},[1095],{"type":25,"value":1096},"        }\n",{"type":20,"tag":166,"props":1098,"children":1100},{"class":168,"line":1099},38,[1101],{"type":20,"tag":166,"props":1102,"children":1103},{"style":185},[1104],{"type":25,"value":1105},"      }\n",{"type":20,"tag":166,"props":1107,"children":1109},{"class":168,"line":1108},39,[1110],{"type":20,"tag":166,"props":1111,"children":1112},{"style":185},[1113],{"type":25,"value":567},{"type":20,"tag":166,"props":1115,"children":1117},{"class":168,"line":1116},40,[1118],{"type":20,"tag":166,"props":1119,"children":1120},{"style":185},[1121],{"type":25,"value":1122},"  }\n",{"type":20,"tag":166,"props":1124,"children":1126},{"class":168,"line":1125},41,[1127],{"type":20,"tag":166,"props":1128,"children":1129},{"style":185},[1130],{"type":25,"value":1131},"}\n",{"type":20,"tag":21,"props":1133,"children":1134},{},[1135,1137,1143,1145,1151,1153,1159,1161,1167],{"type":25,"value":1136},"In a controller that supplies RSS feed simply project your data onto ",{"type":20,"tag":118,"props":1138,"children":1140},{"className":1139},[],[1141],{"type":25,"value":1142},"SyndicationItem",{"type":25,"value":1144},"s and create a ",{"type":20,"tag":118,"props":1146,"children":1148},{"className":1147},[],[1149],{"type":25,"value":1150},"SyndicationFeed",{"type":25,"value":1152}," then return a ",{"type":20,"tag":118,"props":1154,"children":1156},{"className":1155},[],[1157],{"type":25,"value":1158},"FeedResult",{"type":25,"value":1160}," with the ",{"type":20,"tag":118,"props":1162,"children":1164},{"className":1163},[],[1165],{"type":25,"value":1166},"FeedFormatter",{"type":25,"value":1168}," of your choice.",{"type":20,"tag":155,"props":1170,"children":1172},{"className":157,"code":1171,"language":159,"meta":160,"style":160},"public ActionResult NewPosts() {\n  var blog = data.Blogs.SingleOrDefault();\n  var postItems = data.Posts.Where(p => p.Blog = blog)\n    .OrderBy(p => p.PublishedDate)\n    .Take(25)\n    .Select(p => new SyndicationItem(p.Title, p.Content, new Uri(p.Url)));\n\n  var feed = new SyndicationFeed(blog.Title, blog.Description, new Uri(blog.Url) , postItems) {\n    Copyright = blog.Copyright,\n    Language = \"en-US\"\n  };\n\n  return new FeedResult(new Rss20FeedFormatter(feed));\n}\n",[1173],{"type":20,"tag":118,"props":1174,"children":1175},{"__ignoreMap":160},[1176,1199,1240,1306,1344,1369,1451,1458,1527,1554,1580,1588,1595,1629],{"type":20,"tag":166,"props":1177,"children":1178},{"class":168,"line":169},[1179,1184,1189,1194],{"type":20,"tag":166,"props":1180,"children":1181},{"style":381},[1182],{"type":25,"value":1183},"public",{"type":20,"tag":166,"props":1185,"children":1186},{"style":403},[1187],{"type":25,"value":1188}," ActionResult",{"type":20,"tag":166,"props":1190,"children":1191},{"style":586},[1192],{"type":25,"value":1193}," NewPosts",{"type":20,"tag":166,"props":1195,"children":1196},{"style":185},[1197],{"type":25,"value":1198},"() {\n",{"type":20,"tag":166,"props":1200,"children":1201},{"class":168,"line":191},[1202,1207,1212,1216,1221,1226,1230,1235],{"type":20,"tag":166,"props":1203,"children":1204},{"style":433},[1205],{"type":25,"value":1206},"  var",{"type":20,"tag":166,"props":1208,"children":1209},{"style":185},[1210],{"type":25,"value":1211}," blog ",{"type":20,"tag":166,"props":1213,"children":1214},{"style":381},[1215],{"type":25,"value":796},{"type":20,"tag":166,"props":1217,"children":1218},{"style":185},[1219],{"type":25,"value":1220}," data.",{"type":20,"tag":166,"props":1222,"children":1223},{"style":626},[1224],{"type":25,"value":1225},"Blogs",{"type":20,"tag":166,"props":1227,"children":1228},{"style":185},[1229],{"type":25,"value":205},{"type":20,"tag":166,"props":1231,"children":1232},{"style":586},[1233],{"type":25,"value":1234},"SingleOrDefault",{"type":20,"tag":166,"props":1236,"children":1237},{"style":185},[1238],{"type":25,"value":1239},"();\n",{"type":20,"tag":166,"props":1241,"children":1242},{"class":168,"line":226},[1243,1247,1252,1256,1260,1265,1269,1274,1278,1282,1287,1292,1297,1301],{"type":20,"tag":166,"props":1244,"children":1245},{"style":433},[1246],{"type":25,"value":1206},{"type":20,"tag":166,"props":1248,"children":1249},{"style":185},[1250],{"type":25,"value":1251}," postItems ",{"type":20,"tag":166,"props":1253,"children":1254},{"style":381},[1255],{"type":25,"value":796},{"type":20,"tag":166,"props":1257,"children":1258},{"style":185},[1259],{"type":25,"value":1220},{"type":20,"tag":166,"props":1261,"children":1262},{"style":626},[1263],{"type":25,"value":1264},"Posts",{"type":20,"tag":166,"props":1266,"children":1267},{"style":185},[1268],{"type":25,"value":205},{"type":20,"tag":166,"props":1270,"children":1271},{"style":586},[1272],{"type":25,"value":1273},"Where",{"type":20,"tag":166,"props":1275,"children":1276},{"style":185},[1277],{"type":25,"value":593},{"type":20,"tag":166,"props":1279,"children":1280},{"style":601},[1281],{"type":25,"value":21},{"type":20,"tag":166,"props":1283,"children":1284},{"style":381},[1285],{"type":25,"value":1286}," =>",{"type":20,"tag":166,"props":1288,"children":1289},{"style":185},[1290],{"type":25,"value":1291}," p.",{"type":20,"tag":166,"props":1293,"children":1294},{"style":626},[1295],{"type":25,"value":1296},"Blog",{"type":20,"tag":166,"props":1298,"children":1299},{"style":381},[1300],{"type":25,"value":634},{"type":20,"tag":166,"props":1302,"children":1303},{"style":185},[1304],{"type":25,"value":1305}," blog)\n",{"type":20,"tag":166,"props":1307,"children":1308},{"class":168,"line":251},[1309,1314,1319,1323,1327,1331,1335,1340],{"type":20,"tag":166,"props":1310,"children":1311},{"style":185},[1312],{"type":25,"value":1313},"    .",{"type":20,"tag":166,"props":1315,"children":1316},{"style":586},[1317],{"type":25,"value":1318},"OrderBy",{"type":20,"tag":166,"props":1320,"children":1321},{"style":185},[1322],{"type":25,"value":593},{"type":20,"tag":166,"props":1324,"children":1325},{"style":601},[1326],{"type":25,"value":21},{"type":20,"tag":166,"props":1328,"children":1329},{"style":381},[1330],{"type":25,"value":1286},{"type":20,"tag":166,"props":1332,"children":1333},{"style":185},[1334],{"type":25,"value":1291},{"type":20,"tag":166,"props":1336,"children":1337},{"style":626},[1338],{"type":25,"value":1339},"PublishedDate",{"type":20,"tag":166,"props":1341,"children":1342},{"style":185},[1343],{"type":25,"value":725},{"type":20,"tag":166,"props":1345,"children":1346},{"class":168,"line":276},[1347,1351,1356,1360,1365],{"type":20,"tag":166,"props":1348,"children":1349},{"style":185},[1350],{"type":25,"value":1313},{"type":20,"tag":166,"props":1352,"children":1353},{"style":586},[1354],{"type":25,"value":1355},"Take",{"type":20,"tag":166,"props":1357,"children":1358},{"style":185},[1359],{"type":25,"value":593},{"type":20,"tag":166,"props":1361,"children":1362},{"style":717},[1363],{"type":25,"value":1364},"25",{"type":20,"tag":166,"props":1366,"children":1367},{"style":185},[1368],{"type":25,"value":725},{"type":20,"tag":166,"props":1370,"children":1371},{"class":168,"line":309},[1372,1376,1381,1385,1389,1393,1397,1402,1407,1412,1417,1422,1427,1432,1437,1441,1446],{"type":20,"tag":166,"props":1373,"children":1374},{"style":185},[1375],{"type":25,"value":1313},{"type":20,"tag":166,"props":1377,"children":1378},{"style":586},[1379],{"type":25,"value":1380},"Select",{"type":20,"tag":166,"props":1382,"children":1383},{"style":185},[1384],{"type":25,"value":593},{"type":20,"tag":166,"props":1386,"children":1387},{"style":601},[1388],{"type":25,"value":21},{"type":20,"tag":166,"props":1390,"children":1391},{"style":381},[1392],{"type":25,"value":1286},{"type":20,"tag":166,"props":1394,"children":1395},{"style":173},[1396],{"type":25,"value":739},{"type":20,"tag":166,"props":1398,"children":1399},{"style":403},[1400],{"type":25,"value":1401}," SyndicationItem",{"type":20,"tag":166,"props":1403,"children":1404},{"style":185},[1405],{"type":25,"value":1406},"(p.",{"type":20,"tag":166,"props":1408,"children":1409},{"style":626},[1410],{"type":25,"value":1411},"Title",{"type":20,"tag":166,"props":1413,"children":1414},{"style":185},[1415],{"type":25,"value":1416},", p.",{"type":20,"tag":166,"props":1418,"children":1419},{"style":626},[1420],{"type":25,"value":1421},"Content",{"type":20,"tag":166,"props":1423,"children":1424},{"style":185},[1425],{"type":25,"value":1426},", ",{"type":20,"tag":166,"props":1428,"children":1429},{"style":173},[1430],{"type":25,"value":1431},"new",{"type":20,"tag":166,"props":1433,"children":1434},{"style":403},[1435],{"type":25,"value":1436}," Uri",{"type":20,"tag":166,"props":1438,"children":1439},{"style":185},[1440],{"type":25,"value":1406},{"type":20,"tag":166,"props":1442,"children":1443},{"style":626},[1444],{"type":25,"value":1445},"Url",{"type":20,"tag":166,"props":1447,"children":1448},{"style":185},[1449],{"type":25,"value":1450},")));\n",{"type":20,"tag":166,"props":1452,"children":1453},{"class":168,"line":334},[1454],{"type":20,"tag":166,"props":1455,"children":1456},{"emptyLinePlaceholder":338},[1457],{"type":25,"value":341},{"type":20,"tag":166,"props":1459,"children":1460},{"class":168,"line":344},[1461,1465,1470,1474,1478,1483,1488,1492,1497,1502,1506,1510,1514,1518,1522],{"type":20,"tag":166,"props":1462,"children":1463},{"style":433},[1464],{"type":25,"value":1206},{"type":20,"tag":166,"props":1466,"children":1467},{"style":185},[1468],{"type":25,"value":1469}," feed ",{"type":20,"tag":166,"props":1471,"children":1472},{"style":381},[1473],{"type":25,"value":796},{"type":20,"tag":166,"props":1475,"children":1476},{"style":173},[1477],{"type":25,"value":739},{"type":20,"tag":166,"props":1479,"children":1480},{"style":403},[1481],{"type":25,"value":1482}," SyndicationFeed",{"type":20,"tag":166,"props":1484,"children":1485},{"style":185},[1486],{"type":25,"value":1487},"(blog.",{"type":20,"tag":166,"props":1489,"children":1490},{"style":626},[1491],{"type":25,"value":1411},{"type":20,"tag":166,"props":1493,"children":1494},{"style":185},[1495],{"type":25,"value":1496},", blog.",{"type":20,"tag":166,"props":1498,"children":1499},{"style":626},[1500],{"type":25,"value":1501},"Description",{"type":20,"tag":166,"props":1503,"children":1504},{"style":185},[1505],{"type":25,"value":1426},{"type":20,"tag":166,"props":1507,"children":1508},{"style":173},[1509],{"type":25,"value":1431},{"type":20,"tag":166,"props":1511,"children":1512},{"style":403},[1513],{"type":25,"value":1436},{"type":20,"tag":166,"props":1515,"children":1516},{"style":185},[1517],{"type":25,"value":1487},{"type":20,"tag":166,"props":1519,"children":1520},{"style":626},[1521],{"type":25,"value":1445},{"type":20,"tag":166,"props":1523,"children":1524},{"style":185},[1525],{"type":25,"value":1526},") , postItems) {\n",{"type":20,"tag":166,"props":1528,"children":1529},{"class":168,"line":368},[1530,1535,1539,1544,1549],{"type":20,"tag":166,"props":1531,"children":1532},{"style":185},[1533],{"type":25,"value":1534},"    Copyright ",{"type":20,"tag":166,"props":1536,"children":1537},{"style":381},[1538],{"type":25,"value":796},{"type":20,"tag":166,"props":1540,"children":1541},{"style":185},[1542],{"type":25,"value":1543}," blog.",{"type":20,"tag":166,"props":1545,"children":1546},{"style":626},[1547],{"type":25,"value":1548},"Copyright",{"type":20,"tag":166,"props":1550,"children":1551},{"style":185},[1552],{"type":25,"value":1553},",\n",{"type":20,"tag":166,"props":1555,"children":1556},{"class":168,"line":377},[1557,1562,1566,1570,1575],{"type":20,"tag":166,"props":1558,"children":1559},{"style":185},[1560],{"type":25,"value":1561},"    Language ",{"type":20,"tag":166,"props":1563,"children":1564},{"style":381},[1565],{"type":25,"value":796},{"type":20,"tag":166,"props":1567,"children":1568},{"style":751},[1569],{"type":25,"value":881},{"type":20,"tag":166,"props":1571,"children":1572},{"style":757},[1573],{"type":25,"value":1574},"en-US",{"type":20,"tag":166,"props":1576,"children":1577},{"style":751},[1578],{"type":25,"value":1579},"\"\n",{"type":20,"tag":166,"props":1581,"children":1582},{"class":168,"line":414},[1583],{"type":20,"tag":166,"props":1584,"children":1585},{"style":185},[1586],{"type":25,"value":1587},"  };\n",{"type":20,"tag":166,"props":1589,"children":1590},{"class":168,"line":454},[1591],{"type":20,"tag":166,"props":1592,"children":1593},{"emptyLinePlaceholder":338},[1594],{"type":25,"value":341},{"type":20,"tag":166,"props":1596,"children":1597},{"class":168,"line":488},[1598,1603,1607,1611,1615,1619,1624],{"type":20,"tag":166,"props":1599,"children":1600},{"style":173},[1601],{"type":25,"value":1602},"  return",{"type":20,"tag":166,"props":1604,"children":1605},{"style":173},[1606],{"type":25,"value":739},{"type":20,"tag":166,"props":1608,"children":1609},{"style":403},[1610],{"type":25,"value":395},{"type":20,"tag":166,"props":1612,"children":1613},{"style":185},[1614],{"type":25,"value":593},{"type":20,"tag":166,"props":1616,"children":1617},{"style":173},[1618],{"type":25,"value":1431},{"type":20,"tag":166,"props":1620,"children":1621},{"style":403},[1622],{"type":25,"value":1623}," Rss20FeedFormatter",{"type":20,"tag":166,"props":1625,"children":1626},{"style":185},[1627],{"type":25,"value":1628},"(feed));\n",{"type":20,"tag":166,"props":1630,"children":1631},{"class":168,"line":496},[1632],{"type":20,"tag":166,"props":1633,"children":1634},{"style":185},[1635],{"type":25,"value":1131},{"type":20,"tag":21,"props":1637,"children":1638},{},[1639],{"type":25,"value":1640},"This also has a few additional advantages:",{"type":20,"tag":1642,"props":1643,"children":1644},"ol",{},[1645,1662,1675],{"type":20,"tag":56,"props":1646,"children":1647},{},[1648,1650,1655,1657],{"type":25,"value":1649},"Unit tests can ensure the ",{"type":20,"tag":118,"props":1651,"children":1653},{"className":1652},[],[1654],{"type":25,"value":406},{"type":25,"value":1656}," is a ",{"type":20,"tag":118,"props":1658,"children":1660},{"className":1659},[],[1661],{"type":25,"value":1158},{"type":20,"tag":56,"props":1663,"children":1664},{},[1665,1667,1673],{"type":25,"value":1666},"Unit tests can examine the ",{"type":20,"tag":118,"props":1668,"children":1670},{"className":1669},[],[1671],{"type":25,"value":1672},"Feed",{"type":25,"value":1674}," property to examine results without parsing XML",{"type":20,"tag":56,"props":1676,"children":1677},{},[1678,1680,1685,1687],{"type":25,"value":1679},"Switching to Atom format involved just changing the new ",{"type":20,"tag":118,"props":1681,"children":1683},{"className":1682},[],[1684],{"type":25,"value":139},{"type":25,"value":1686}," to ",{"type":20,"tag":118,"props":1688,"children":1690},{"className":1689},[],[1691],{"type":25,"value":146},{"type":20,"tag":21,"props":1693,"children":1694},{},[1695],{"type":20,"tag":60,"props":1696,"children":1697},{},[1698],{"type":25,"value":1699},"[)amien",{"type":20,"tag":1701,"props":1702,"children":1703},"style",{},[1704],{"type":25,"value":1705},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":160,"searchDepth":191,"depth":191,"links":1707},[],"markdown","content:blog:2010:creating-rss-feeds-in-asp-net-mvc.md","content","blog/2010/creating-rss-feeds-in-asp-net-mvc.md","blog/2010/creating-rss-feeds-in-asp-net-mvc","md","/blog/2010/creating-rss-feeds-in-asp-net-mvc/",629,[1717,1721,1725],{"title":1718,"date":1719,"url":1720},"HTML5 Video Cheatsheet: Optimizing videos for the web","2025-12-05T00:00:00Z","/blog/2025/html5-video-cheatsheet/",{"title":1722,"date":1723,"url":1724},"Transactions in the MongoDB EF Core Provider","2025-10-25","/blog/2025/mongodb-explicit-transactions/",{"title":1726,"date":1727,"url":1728},"Queryable Encryption with the MongoDB EF Core Provider","2025-09-22","/blog/2025/mongodb-queryable-encryption/",[1730,1783,1821,3129,3159],{"_path":1731,"_dir":1732,"_draft":6,"_partial":6,"_locale":7,"title":1733,"description":1734,"id":1735,"name":1736,"email":1737,"avatar":1738,"url":1739,"date":1740,"body":1741,"_type":1708,"_id":1780,"_source":1710,"_file":1781,"_stem":1782,"_extension":1713},"/comments/creating-rss-feeds-in-asp-net-mvc/47369","creating-rss-feeds-in-asp-net-mvc","47369","Thanks! I used the RSS feed ActionResult in building MessianicChords.com. In particular, I used it to generate an RSS feed for user-uploaded content to the site. That feed is then consumed by IfThisThenThat, which publishes new RSS items to Twitter and Facebook. Pretty cool stuff.",47369,"Judah Gabriel Himango","judahgabriel@gmail.com","https://www.gravatar.com/avatar/2142b1a501386ed0af9232862af48df9?r=pg&d=retro","https://debuggerdotbreak.wordpress.com","2012-02-16T11:53:35",{"type":17,"children":1742,"toc":1778},[1743,1773],{"type":20,"tag":21,"props":1744,"children":1745},{},[1746,1748,1755,1757,1763,1765,1771],{"type":25,"value":1747},"Thanks! I used the RSS feed ActionResult in building ",{"type":20,"tag":1749,"props":1750,"children":1752},"a",{"href":1751},"https://messianicchords.com",[1753],{"type":25,"value":1754},"MessianicChords.com",{"type":25,"value":1756},". In particular, I used it to ",{"type":20,"tag":1749,"props":1758,"children":1760},{"href":1759},"https://messianicchords.com/",[1761],{"type":25,"value":1762},"generate an RSS feed for user-uploaded content to the site",{"type":25,"value":1764},". That feed is then consumed by ",{"type":20,"tag":1749,"props":1766,"children":1768},{"href":1767},"https://ifttt.com",[1769],{"type":25,"value":1770},"IfThisThenThat",{"type":25,"value":1772},", which publishes new RSS items to Twitter and Facebook. Pretty cool stuff.",{"type":20,"tag":21,"props":1774,"children":1775},{},[1776],{"type":25,"value":1777},"Thanks again for posting this RSS ActionResult, was very helpful.",{"title":160,"searchDepth":191,"depth":191,"links":1779},[],"content:comments:creating-rss-feeds-in-asp-net-mvc:47369.md","comments/creating-rss-feeds-in-asp-net-mvc/47369.md","comments/creating-rss-feeds-in-asp-net-mvc/47369",{"_path":1784,"_dir":1732,"_draft":6,"_partial":6,"_locale":7,"title":1785,"description":1786,"id":1787,"name":1788,"email":1789,"avatar":1790,"url":1791,"date":1792,"body":1793,"_type":1708,"_id":1818,"_source":1710,"_file":1819,"_stem":1820,"_extension":1713},"/comments/creating-rss-feeds-in-asp-net-mvc/45755","45755","I just got a message regarding my above comment. Appears that the markup stripping in this blog has stripped out some of the code, which makes my comment appear insane!",45755,"David Whitney","david@davidwhitney.co.uk","https://www.gravatar.com/avatar/4b8b52cbcc5f85f18eb4a3a7cd453c23?r=pg&d=retro","https://www.davidwhitney.co.uk","2011-06-15T06:13:28",{"type":17,"children":1794,"toc":1816},[1795,1799,1811],{"type":20,"tag":21,"props":1796,"children":1797},{},[1798],{"type":25,"value":1786},{"type":20,"tag":21,"props":1800,"children":1801},{},[1802,1804],{"type":25,"value":1803},"Here's a gist with the snippet that might make it make sense: ",{"type":20,"tag":1749,"props":1805,"children":1809},{"href":1806,"rel":1807},"https://gist.github.com/1027181",[1808],"nofollow",[1810],{"type":25,"value":1806},{"type":20,"tag":21,"props":1812,"children":1813},{},[1814],{"type":25,"value":1815},"The issue we were having was that  elements were getting HTMLEncoded by default, ruining their entire purpose.",{"title":160,"searchDepth":191,"depth":191,"links":1817},[],"content:comments:creating-rss-feeds-in-asp-net-mvc:45755.md","comments/creating-rss-feeds-in-asp-net-mvc/45755.md","comments/creating-rss-feeds-in-asp-net-mvc/45755",{"_path":1822,"_dir":1732,"_draft":6,"_partial":6,"_locale":7,"title":1823,"description":1824,"id":1825,"name":1788,"email":1789,"avatar":1790,"url":1791,"date":1826,"body":1827,"_type":1708,"_id":3126,"_source":1710,"_file":3127,"_stem":3128,"_extension":1713},"/comments/creating-rss-feeds-in-asp-net-mvc/41330","41330","I've been using a similar method for producing feeds for some time.\nI've found that you suffer if you start requiring CDATA.",41330,"2010-04-29T04:55:57",{"type":17,"children":1828,"toc":3124},[1829,1833,1838,3120],{"type":20,"tag":21,"props":1830,"children":1831},{},[1832],{"type":25,"value":1824},{"type":20,"tag":21,"props":1834,"children":1835},{},[1836],{"type":25,"value":1837},"While my solution isn't quite ideal, this is the technique I use to get around the lack of CDATA support in the .NET SyndicationFeed objects.",{"type":20,"tag":155,"props":1839,"children":1841},{"className":157,"code":1840,"language":159,"meta":160,"style":160},"public class RssResult : ActionResult {\n    public SyndicationFeed Feed { get; set; }\n\n    public RssResult(SyndicationFeed feed) {\n        Feed = feed;\n    }\n\n    public override void ExecuteResult(ControllerContext context) {\n        context.HttpContext.Response.ContentType = \"application/xml\";\n        var rssFormatter = new Rss20FeedFormatter(Feed);\n        var settings = new XmlWriterSettings {\n            NewLineHandling = NewLineHandling.None,\n            Indent = true,\n            Encoding = Encoding.UTF32,\n            ConformanceLevel = ConformanceLevel.Document,\n            OmitXmlDeclaration = true\n        };\n\n        var buffer = new StringBuilder();\n        var cachedOutput = new StringWriter(buffer);\n\n        using (var writer = XmlWriter.Create(cachedOutput, settings)) {\n            if (writer != null) {\n                rssFormatter.WriteTo(writer);\n                writer.Close();\n            }\n        }\n\n        var xmlDoc =  XDocument.Parse(buffer.ToString());\n        foreach (var element in xmlDoc.Descendants(\"channel\").First().Descendants(\"item\").Descendants(\"description\"))\n            VerifyCdataHtmlEncoding(buffer, element);\n\n        foreach (var element in xmlDoc.Descendants(\"channel\").First().Descendants(\"description\"))\n            VerifyCdataHtmlEncoding(buffer, element);\n\n        buffer.Replace(\" xmlns:a10=\\\"http://www.w3.org/2005/Atom\\\"\", \" xmlns:atom=\\\"http://www.w3.org/2005/Atom\\\"\");\n        buffer.Replace(\"a10:\", \"atom:\");\n\n        context.HttpContext.Response.Output.Write(buffer.ToString());\n    }\n\n    private static void VerifyCdataHtmlEncoding(StringBuilder buffer, XElement element) {\n        if(element.Value.Contains(\"\")) {\n            string cdataValue = string.Format(\"\", element.Name, element.Value, element.Name);\n            buffer.Replace(element.ToString(), cdataValue);\n        }\n    }\n}\n",[1842],{"type":20,"tag":118,"props":1843,"children":1844},{"__ignoreMap":160},[1845,1873,1905,1912,1939,1955,1962,1969,2004,2053,2083,2112,2138,2159,2185,2211,2228,2236,2243,2272,2302,2309,2348,2373,2390,2407,2415,2422,2429,2470,2589,2602,2609,2692,2703,2710,2788,2837,2844,2892,2899,2906,2960,3001,3070,3096,3104,3112],{"type":20,"tag":166,"props":1846,"children":1847},{"class":168,"line":169},[1848,1852,1856,1861,1865,1869],{"type":20,"tag":166,"props":1849,"children":1850},{"style":381},[1851],{"type":25,"value":1183},{"type":20,"tag":166,"props":1853,"children":1854},{"style":173},[1855],{"type":25,"value":389},{"type":20,"tag":166,"props":1857,"children":1858},{"style":392},[1859],{"type":25,"value":1860}," RssResult",{"type":20,"tag":166,"props":1862,"children":1863},{"style":185},[1864],{"type":25,"value":400},{"type":20,"tag":166,"props":1866,"children":1867},{"style":403},[1868],{"type":25,"value":406},{"type":20,"tag":166,"props":1870,"children":1871},{"style":185},[1872],{"type":25,"value":411},{"type":20,"tag":166,"props":1874,"children":1875},{"class":168,"line":191},[1876,1880,1884,1889,1893,1897,1901],{"type":20,"tag":166,"props":1877,"children":1878},{"style":381},[1879],{"type":25,"value":420},{"type":20,"tag":166,"props":1881,"children":1882},{"style":403},[1883],{"type":25,"value":1482},{"type":20,"tag":166,"props":1885,"children":1886},{"style":185},[1887],{"type":25,"value":1888}," Feed { ",{"type":20,"tag":166,"props":1890,"children":1891},{"style":433},[1892],{"type":25,"value":436},{"type":20,"tag":166,"props":1894,"children":1895},{"style":185},[1896],{"type":25,"value":441},{"type":20,"tag":166,"props":1898,"children":1899},{"style":433},[1900],{"type":25,"value":446},{"type":20,"tag":166,"props":1902,"children":1903},{"style":185},[1904],{"type":25,"value":451},{"type":20,"tag":166,"props":1906,"children":1907},{"class":168,"line":226},[1908],{"type":20,"tag":166,"props":1909,"children":1910},{"emptyLinePlaceholder":338},[1911],{"type":25,"value":341},{"type":20,"tag":166,"props":1913,"children":1914},{"class":168,"line":251},[1915,1919,1923,1927,1931,1935],{"type":20,"tag":166,"props":1916,"children":1917},{"style":381},[1918],{"type":25,"value":420},{"type":20,"tag":166,"props":1920,"children":1921},{"style":586},[1922],{"type":25,"value":1860},{"type":20,"tag":166,"props":1924,"children":1925},{"style":185},[1926],{"type":25,"value":593},{"type":20,"tag":166,"props":1928,"children":1929},{"style":403},[1930],{"type":25,"value":1150},{"type":20,"tag":166,"props":1932,"children":1933},{"style":601},[1934],{"type":25,"value":604},{"type":20,"tag":166,"props":1936,"children":1937},{"style":185},[1938],{"type":25,"value":609},{"type":20,"tag":166,"props":1940,"children":1941},{"class":168,"line":276},[1942,1947,1951],{"type":20,"tag":166,"props":1943,"children":1944},{"style":185},[1945],{"type":25,"value":1946},"        Feed ",{"type":20,"tag":166,"props":1948,"children":1949},{"style":381},[1950],{"type":25,"value":796},{"type":20,"tag":166,"props":1952,"children":1953},{"style":185},[1954],{"type":25,"value":517},{"type":20,"tag":166,"props":1956,"children":1957},{"class":168,"line":309},[1958],{"type":20,"tag":166,"props":1959,"children":1960},{"style":185},[1961],{"type":25,"value":567},{"type":20,"tag":166,"props":1963,"children":1964},{"class":168,"line":334},[1965],{"type":20,"tag":166,"props":1966,"children":1967},{"emptyLinePlaceholder":338},[1968],{"type":25,"value":341},{"type":20,"tag":166,"props":1970,"children":1971},{"class":168,"line":344},[1972,1976,1980,1984,1988,1992,1996,2000],{"type":20,"tag":166,"props":1973,"children":1974},{"style":381},[1975],{"type":25,"value":420},{"type":20,"tag":166,"props":1977,"children":1978},{"style":381},[1979],{"type":25,"value":667},{"type":20,"tag":166,"props":1981,"children":1982},{"style":433},[1983],{"type":25,"value":672},{"type":20,"tag":166,"props":1985,"children":1986},{"style":586},[1987],{"type":25,"value":677},{"type":20,"tag":166,"props":1989,"children":1990},{"style":185},[1991],{"type":25,"value":593},{"type":20,"tag":166,"props":1993,"children":1994},{"style":403},[1995],{"type":25,"value":686},{"type":20,"tag":166,"props":1997,"children":1998},{"style":601},[1999],{"type":25,"value":691},{"type":20,"tag":166,"props":2001,"children":2002},{"style":185},[2003],{"type":25,"value":609},{"type":20,"tag":166,"props":2005,"children":2006},{"class":168,"line":368},[2007,2012,2016,2020,2024,2028,2032,2036,2040,2045,2049],{"type":20,"tag":166,"props":2008,"children":2009},{"style":185},[2010],{"type":25,"value":2011},"        context.",{"type":20,"tag":166,"props":2013,"children":2014},{"style":626},[2015],{"type":25,"value":806},{"type":20,"tag":166,"props":2017,"children":2018},{"style":185},[2019],{"type":25,"value":205},{"type":20,"tag":166,"props":2021,"children":2022},{"style":626},[2023],{"type":25,"value":815},{"type":20,"tag":166,"props":2025,"children":2026},{"style":185},[2027],{"type":25,"value":205},{"type":20,"tag":166,"props":2029,"children":2030},{"style":626},[2031],{"type":25,"value":833},{"type":20,"tag":166,"props":2033,"children":2034},{"style":381},[2035],{"type":25,"value":634},{"type":20,"tag":166,"props":2037,"children":2038},{"style":751},[2039],{"type":25,"value":881},{"type":20,"tag":166,"props":2041,"children":2042},{"style":757},[2043],{"type":25,"value":2044},"application/xml",{"type":20,"tag":166,"props":2046,"children":2047},{"style":751},[2048],{"type":25,"value":754},{"type":20,"tag":166,"props":2050,"children":2051},{"style":185},[2052],{"type":25,"value":188},{"type":20,"tag":166,"props":2054,"children":2055},{"class":168,"line":377},[2056,2061,2066,2070,2074,2078],{"type":20,"tag":166,"props":2057,"children":2058},{"style":433},[2059],{"type":25,"value":2060},"        var",{"type":20,"tag":166,"props":2062,"children":2063},{"style":185},[2064],{"type":25,"value":2065}," rssFormatter ",{"type":20,"tag":166,"props":2067,"children":2068},{"style":381},[2069],{"type":25,"value":796},{"type":20,"tag":166,"props":2071,"children":2072},{"style":173},[2073],{"type":25,"value":739},{"type":20,"tag":166,"props":2075,"children":2076},{"style":403},[2077],{"type":25,"value":1623},{"type":20,"tag":166,"props":2079,"children":2080},{"style":185},[2081],{"type":25,"value":2082},"(Feed);\n",{"type":20,"tag":166,"props":2084,"children":2085},{"class":168,"line":414},[2086,2090,2095,2099,2103,2108],{"type":20,"tag":166,"props":2087,"children":2088},{"style":433},[2089],{"type":25,"value":2060},{"type":20,"tag":166,"props":2091,"children":2092},{"style":185},[2093],{"type":25,"value":2094}," settings ",{"type":20,"tag":166,"props":2096,"children":2097},{"style":381},[2098],{"type":25,"value":796},{"type":20,"tag":166,"props":2100,"children":2101},{"style":173},[2102],{"type":25,"value":739},{"type":20,"tag":166,"props":2104,"children":2105},{"style":403},[2106],{"type":25,"value":2107}," XmlWriterSettings",{"type":20,"tag":166,"props":2109,"children":2110},{"style":185},[2111],{"type":25,"value":411},{"type":20,"tag":166,"props":2113,"children":2114},{"class":168,"line":454},[2115,2120,2124,2129,2134],{"type":20,"tag":166,"props":2116,"children":2117},{"style":185},[2118],{"type":25,"value":2119},"            NewLineHandling ",{"type":20,"tag":166,"props":2121,"children":2122},{"style":381},[2123],{"type":25,"value":796},{"type":20,"tag":166,"props":2125,"children":2126},{"style":185},[2127],{"type":25,"value":2128}," NewLineHandling.",{"type":20,"tag":166,"props":2130,"children":2131},{"style":626},[2132],{"type":25,"value":2133},"None",{"type":20,"tag":166,"props":2135,"children":2136},{"style":185},[2137],{"type":25,"value":1553},{"type":20,"tag":166,"props":2139,"children":2140},{"class":168,"line":488},[2141,2146,2150,2155],{"type":20,"tag":166,"props":2142,"children":2143},{"style":185},[2144],{"type":25,"value":2145},"            Indent ",{"type":20,"tag":166,"props":2147,"children":2148},{"style":381},[2149],{"type":25,"value":796},{"type":20,"tag":166,"props":2151,"children":2152},{"style":717},[2153],{"type":25,"value":2154}," true",{"type":20,"tag":166,"props":2156,"children":2157},{"style":185},[2158],{"type":25,"value":1553},{"type":20,"tag":166,"props":2160,"children":2161},{"class":168,"line":496},[2162,2167,2171,2176,2181],{"type":20,"tag":166,"props":2163,"children":2164},{"style":185},[2165],{"type":25,"value":2166},"            Encoding ",{"type":20,"tag":166,"props":2168,"children":2169},{"style":381},[2170],{"type":25,"value":796},{"type":20,"tag":166,"props":2172,"children":2173},{"style":185},[2174],{"type":25,"value":2175}," Encoding.",{"type":20,"tag":166,"props":2177,"children":2178},{"style":626},[2179],{"type":25,"value":2180},"UTF32",{"type":20,"tag":166,"props":2182,"children":2183},{"style":185},[2184],{"type":25,"value":1553},{"type":20,"tag":166,"props":2186,"children":2187},{"class":168,"line":520},[2188,2193,2197,2202,2207],{"type":20,"tag":166,"props":2189,"children":2190},{"style":185},[2191],{"type":25,"value":2192},"            ConformanceLevel ",{"type":20,"tag":166,"props":2194,"children":2195},{"style":381},[2196],{"type":25,"value":796},{"type":20,"tag":166,"props":2198,"children":2199},{"style":185},[2200],{"type":25,"value":2201}," ConformanceLevel.",{"type":20,"tag":166,"props":2203,"children":2204},{"style":626},[2205],{"type":25,"value":2206},"Document",{"type":20,"tag":166,"props":2208,"children":2209},{"style":185},[2210],{"type":25,"value":1553},{"type":20,"tag":166,"props":2212,"children":2213},{"class":168,"line":537},[2214,2219,2223],{"type":20,"tag":166,"props":2215,"children":2216},{"style":185},[2217],{"type":25,"value":2218},"            OmitXmlDeclaration ",{"type":20,"tag":166,"props":2220,"children":2221},{"style":381},[2222],{"type":25,"value":796},{"type":20,"tag":166,"props":2224,"children":2225},{"style":717},[2226],{"type":25,"value":2227}," true\n",{"type":20,"tag":166,"props":2229,"children":2230},{"class":168,"line":561},[2231],{"type":20,"tag":166,"props":2232,"children":2233},{"style":185},[2234],{"type":25,"value":2235},"        };\n",{"type":20,"tag":166,"props":2237,"children":2238},{"class":168,"line":570},[2239],{"type":20,"tag":166,"props":2240,"children":2241},{"emptyLinePlaceholder":338},[2242],{"type":25,"value":341},{"type":20,"tag":166,"props":2244,"children":2245},{"class":168,"line":578},[2246,2250,2255,2259,2263,2268],{"type":20,"tag":166,"props":2247,"children":2248},{"style":433},[2249],{"type":25,"value":2060},{"type":20,"tag":166,"props":2251,"children":2252},{"style":185},[2253],{"type":25,"value":2254}," buffer ",{"type":20,"tag":166,"props":2256,"children":2257},{"style":381},[2258],{"type":25,"value":796},{"type":20,"tag":166,"props":2260,"children":2261},{"style":173},[2262],{"type":25,"value":739},{"type":20,"tag":166,"props":2264,"children":2265},{"style":403},[2266],{"type":25,"value":2267}," StringBuilder",{"type":20,"tag":166,"props":2269,"children":2270},{"style":185},[2271],{"type":25,"value":1239},{"type":20,"tag":166,"props":2273,"children":2274},{"class":168,"line":612},[2275,2279,2284,2288,2292,2297],{"type":20,"tag":166,"props":2276,"children":2277},{"style":433},[2278],{"type":25,"value":2060},{"type":20,"tag":166,"props":2280,"children":2281},{"style":185},[2282],{"type":25,"value":2283}," cachedOutput ",{"type":20,"tag":166,"props":2285,"children":2286},{"style":381},[2287],{"type":25,"value":796},{"type":20,"tag":166,"props":2289,"children":2290},{"style":173},[2291],{"type":25,"value":739},{"type":20,"tag":166,"props":2293,"children":2294},{"style":403},[2295],{"type":25,"value":2296}," StringWriter",{"type":20,"tag":166,"props":2298,"children":2299},{"style":185},[2300],{"type":25,"value":2301},"(buffer);\n",{"type":20,"tag":166,"props":2303,"children":2304},{"class":168,"line":641},[2305],{"type":20,"tag":166,"props":2306,"children":2307},{"emptyLinePlaceholder":338},[2308],{"type":25,"value":341},{"type":20,"tag":166,"props":2310,"children":2311},{"class":168,"line":649},[2312,2316,2320,2324,2329,2333,2338,2343],{"type":20,"tag":166,"props":2313,"children":2314},{"style":173},[2315],{"type":25,"value":993},{"type":20,"tag":166,"props":2317,"children":2318},{"style":185},[2319],{"type":25,"value":998},{"type":20,"tag":166,"props":2321,"children":2322},{"style":433},[2323],{"type":25,"value":1003},{"type":20,"tag":166,"props":2325,"children":2326},{"style":185},[2327],{"type":25,"value":2328}," writer ",{"type":20,"tag":166,"props":2330,"children":2331},{"style":381},[2332],{"type":25,"value":796},{"type":20,"tag":166,"props":2334,"children":2335},{"style":185},[2336],{"type":25,"value":2337}," XmlWriter.",{"type":20,"tag":166,"props":2339,"children":2340},{"style":586},[2341],{"type":25,"value":2342},"Create",{"type":20,"tag":166,"props":2344,"children":2345},{"style":185},[2346],{"type":25,"value":2347},"(cachedOutput, settings)) {\n",{"type":20,"tag":166,"props":2349,"children":2350},{"class":168,"line":657},[2351,2356,2361,2365,2369],{"type":20,"tag":166,"props":2352,"children":2353},{"style":173},[2354],{"type":25,"value":2355},"            if",{"type":20,"tag":166,"props":2357,"children":2358},{"style":185},[2359],{"type":25,"value":2360}," (writer ",{"type":20,"tag":166,"props":2362,"children":2363},{"style":381},[2364],{"type":25,"value":920},{"type":20,"tag":166,"props":2366,"children":2367},{"style":717},[2368],{"type":25,"value":720},{"type":20,"tag":166,"props":2370,"children":2371},{"style":185},[2372],{"type":25,"value":609},{"type":20,"tag":166,"props":2374,"children":2375},{"class":168,"line":698},[2376,2381,2385],{"type":20,"tag":166,"props":2377,"children":2378},{"style":185},[2379],{"type":25,"value":2380},"                rssFormatter.",{"type":20,"tag":166,"props":2382,"children":2383},{"style":586},[2384],{"type":25,"value":1082},{"type":20,"tag":166,"props":2386,"children":2387},{"style":185},[2388],{"type":25,"value":2389},"(writer);\n",{"type":20,"tag":166,"props":2391,"children":2392},{"class":168,"line":728},[2393,2398,2403],{"type":20,"tag":166,"props":2394,"children":2395},{"style":185},[2396],{"type":25,"value":2397},"                writer.",{"type":20,"tag":166,"props":2399,"children":2400},{"style":586},[2401],{"type":25,"value":2402},"Close",{"type":20,"tag":166,"props":2404,"children":2405},{"style":185},[2406],{"type":25,"value":1239},{"type":20,"tag":166,"props":2408,"children":2409},{"class":168,"line":772},[2410],{"type":20,"tag":166,"props":2411,"children":2412},{"style":185},[2413],{"type":25,"value":2414},"            }\n",{"type":20,"tag":166,"props":2416,"children":2417},{"class":168,"line":780},[2418],{"type":20,"tag":166,"props":2419,"children":2420},{"style":185},[2421],{"type":25,"value":1096},{"type":20,"tag":166,"props":2423,"children":2424},{"class":168,"line":822},[2425],{"type":20,"tag":166,"props":2426,"children":2427},{"emptyLinePlaceholder":338},[2428],{"type":25,"value":341},{"type":20,"tag":166,"props":2430,"children":2431},{"class":168,"line":897},[2432,2436,2441,2445,2450,2455,2460,2465],{"type":20,"tag":166,"props":2433,"children":2434},{"style":433},[2435],{"type":25,"value":2060},{"type":20,"tag":166,"props":2437,"children":2438},{"style":185},[2439],{"type":25,"value":2440}," xmlDoc ",{"type":20,"tag":166,"props":2442,"children":2443},{"style":381},[2444],{"type":25,"value":796},{"type":20,"tag":166,"props":2446,"children":2447},{"style":185},[2448],{"type":25,"value":2449},"  XDocument.",{"type":20,"tag":166,"props":2451,"children":2452},{"style":586},[2453],{"type":25,"value":2454},"Parse",{"type":20,"tag":166,"props":2456,"children":2457},{"style":185},[2458],{"type":25,"value":2459},"(buffer.",{"type":20,"tag":166,"props":2461,"children":2462},{"style":586},[2463],{"type":25,"value":2464},"ToString",{"type":20,"tag":166,"props":2466,"children":2467},{"style":185},[2468],{"type":25,"value":2469},"());\n",{"type":20,"tag":166,"props":2471,"children":2472},{"class":168,"line":905},[2473,2478,2482,2486,2491,2496,2501,2506,2510,2514,2519,2523,2528,2533,2538,2542,2546,2550,2555,2559,2563,2567,2571,2575,2580,2584],{"type":20,"tag":166,"props":2474,"children":2475},{"style":173},[2476],{"type":25,"value":2477},"        foreach",{"type":20,"tag":166,"props":2479,"children":2480},{"style":185},[2481],{"type":25,"value":998},{"type":20,"tag":166,"props":2483,"children":2484},{"style":433},[2485],{"type":25,"value":1003},{"type":20,"tag":166,"props":2487,"children":2488},{"style":185},[2489],{"type":25,"value":2490}," element ",{"type":20,"tag":166,"props":2492,"children":2493},{"style":173},[2494],{"type":25,"value":2495},"in",{"type":20,"tag":166,"props":2497,"children":2498},{"style":185},[2499],{"type":25,"value":2500}," xmlDoc.",{"type":20,"tag":166,"props":2502,"children":2503},{"style":586},[2504],{"type":25,"value":2505},"Descendants",{"type":20,"tag":166,"props":2507,"children":2508},{"style":185},[2509],{"type":25,"value":593},{"type":20,"tag":166,"props":2511,"children":2512},{"style":751},[2513],{"type":25,"value":754},{"type":20,"tag":166,"props":2515,"children":2516},{"style":757},[2517],{"type":25,"value":2518},"channel",{"type":20,"tag":166,"props":2520,"children":2521},{"style":751},[2522],{"type":25,"value":754},{"type":20,"tag":166,"props":2524,"children":2525},{"style":185},[2526],{"type":25,"value":2527},").",{"type":20,"tag":166,"props":2529,"children":2530},{"style":586},[2531],{"type":25,"value":2532},"First",{"type":20,"tag":166,"props":2534,"children":2535},{"style":185},[2536],{"type":25,"value":2537},"().",{"type":20,"tag":166,"props":2539,"children":2540},{"style":586},[2541],{"type":25,"value":2505},{"type":20,"tag":166,"props":2543,"children":2544},{"style":185},[2545],{"type":25,"value":593},{"type":20,"tag":166,"props":2547,"children":2548},{"style":751},[2549],{"type":25,"value":754},{"type":20,"tag":166,"props":2551,"children":2552},{"style":757},[2553],{"type":25,"value":2554},"item",{"type":20,"tag":166,"props":2556,"children":2557},{"style":751},[2558],{"type":25,"value":754},{"type":20,"tag":166,"props":2560,"children":2561},{"style":185},[2562],{"type":25,"value":2527},{"type":20,"tag":166,"props":2564,"children":2565},{"style":586},[2566],{"type":25,"value":2505},{"type":20,"tag":166,"props":2568,"children":2569},{"style":185},[2570],{"type":25,"value":593},{"type":20,"tag":166,"props":2572,"children":2573},{"style":751},[2574],{"type":25,"value":754},{"type":20,"tag":166,"props":2576,"children":2577},{"style":757},[2578],{"type":25,"value":2579},"description",{"type":20,"tag":166,"props":2581,"children":2582},{"style":751},[2583],{"type":25,"value":754},{"type":20,"tag":166,"props":2585,"children":2586},{"style":185},[2587],{"type":25,"value":2588},"))\n",{"type":20,"tag":166,"props":2590,"children":2591},{"class":168,"line":931},[2592,2597],{"type":20,"tag":166,"props":2593,"children":2594},{"style":586},[2595],{"type":25,"value":2596},"            VerifyCdataHtmlEncoding",{"type":20,"tag":166,"props":2598,"children":2599},{"style":185},[2600],{"type":25,"value":2601},"(buffer, element);\n",{"type":20,"tag":166,"props":2603,"children":2604},{"class":168,"line":954},[2605],{"type":20,"tag":166,"props":2606,"children":2607},{"emptyLinePlaceholder":338},[2608],{"type":25,"value":341},{"type":20,"tag":166,"props":2610,"children":2611},{"class":168,"line":962},[2612,2616,2620,2624,2628,2632,2636,2640,2644,2648,2652,2656,2660,2664,2668,2672,2676,2680,2684,2688],{"type":20,"tag":166,"props":2613,"children":2614},{"style":173},[2615],{"type":25,"value":2477},{"type":20,"tag":166,"props":2617,"children":2618},{"style":185},[2619],{"type":25,"value":998},{"type":20,"tag":166,"props":2621,"children":2622},{"style":433},[2623],{"type":25,"value":1003},{"type":20,"tag":166,"props":2625,"children":2626},{"style":185},[2627],{"type":25,"value":2490},{"type":20,"tag":166,"props":2629,"children":2630},{"style":173},[2631],{"type":25,"value":2495},{"type":20,"tag":166,"props":2633,"children":2634},{"style":185},[2635],{"type":25,"value":2500},{"type":20,"tag":166,"props":2637,"children":2638},{"style":586},[2639],{"type":25,"value":2505},{"type":20,"tag":166,"props":2641,"children":2642},{"style":185},[2643],{"type":25,"value":593},{"type":20,"tag":166,"props":2645,"children":2646},{"style":751},[2647],{"type":25,"value":754},{"type":20,"tag":166,"props":2649,"children":2650},{"style":757},[2651],{"type":25,"value":2518},{"type":20,"tag":166,"props":2653,"children":2654},{"style":751},[2655],{"type":25,"value":754},{"type":20,"tag":166,"props":2657,"children":2658},{"style":185},[2659],{"type":25,"value":2527},{"type":20,"tag":166,"props":2661,"children":2662},{"style":586},[2663],{"type":25,"value":2532},{"type":20,"tag":166,"props":2665,"children":2666},{"style":185},[2667],{"type":25,"value":2537},{"type":20,"tag":166,"props":2669,"children":2670},{"style":586},[2671],{"type":25,"value":2505},{"type":20,"tag":166,"props":2673,"children":2674},{"style":185},[2675],{"type":25,"value":593},{"type":20,"tag":166,"props":2677,"children":2678},{"style":751},[2679],{"type":25,"value":754},{"type":20,"tag":166,"props":2681,"children":2682},{"style":757},[2683],{"type":25,"value":2579},{"type":20,"tag":166,"props":2685,"children":2686},{"style":751},[2687],{"type":25,"value":754},{"type":20,"tag":166,"props":2689,"children":2690},{"style":185},[2691],{"type":25,"value":2588},{"type":20,"tag":166,"props":2693,"children":2694},{"class":168,"line":987},[2695,2699],{"type":20,"tag":166,"props":2696,"children":2697},{"style":586},[2698],{"type":25,"value":2596},{"type":20,"tag":166,"props":2700,"children":2701},{"style":185},[2702],{"type":25,"value":2601},{"type":20,"tag":166,"props":2704,"children":2705},{"class":168,"line":1039},[2706],{"type":20,"tag":166,"props":2707,"children":2708},{"emptyLinePlaceholder":338},[2709],{"type":25,"value":341},{"type":20,"tag":166,"props":2711,"children":2712},{"class":168,"line":1071},[2713,2718,2723,2727,2731,2736,2742,2747,2751,2755,2759,2763,2768,2772,2776,2780,2784],{"type":20,"tag":166,"props":2714,"children":2715},{"style":185},[2716],{"type":25,"value":2717},"        buffer.",{"type":20,"tag":166,"props":2719,"children":2720},{"style":586},[2721],{"type":25,"value":2722},"Replace",{"type":20,"tag":166,"props":2724,"children":2725},{"style":185},[2726],{"type":25,"value":593},{"type":20,"tag":166,"props":2728,"children":2729},{"style":751},[2730],{"type":25,"value":754},{"type":20,"tag":166,"props":2732,"children":2733},{"style":757},[2734],{"type":25,"value":2735}," xmlns:a10=",{"type":20,"tag":166,"props":2737,"children":2739},{"style":2738},"--shiki-default:#DFA000;--shiki-dark:#FF79C6",[2740],{"type":25,"value":2741},"\\\"",{"type":20,"tag":166,"props":2743,"children":2744},{"style":757},[2745],{"type":25,"value":2746},"http://www.w3.org/2005/Atom",{"type":20,"tag":166,"props":2748,"children":2749},{"style":2738},[2750],{"type":25,"value":2741},{"type":20,"tag":166,"props":2752,"children":2753},{"style":751},[2754],{"type":25,"value":754},{"type":20,"tag":166,"props":2756,"children":2757},{"style":185},[2758],{"type":25,"value":1426},{"type":20,"tag":166,"props":2760,"children":2761},{"style":751},[2762],{"type":25,"value":754},{"type":20,"tag":166,"props":2764,"children":2765},{"style":757},[2766],{"type":25,"value":2767}," xmlns:atom=",{"type":20,"tag":166,"props":2769,"children":2770},{"style":2738},[2771],{"type":25,"value":2741},{"type":20,"tag":166,"props":2773,"children":2774},{"style":757},[2775],{"type":25,"value":2746},{"type":20,"tag":166,"props":2777,"children":2778},{"style":2738},[2779],{"type":25,"value":2741},{"type":20,"tag":166,"props":2781,"children":2782},{"style":751},[2783],{"type":25,"value":754},{"type":20,"tag":166,"props":2785,"children":2786},{"style":185},[2787],{"type":25,"value":769},{"type":20,"tag":166,"props":2789,"children":2790},{"class":168,"line":1090},[2791,2795,2799,2803,2807,2812,2816,2820,2824,2829,2833],{"type":20,"tag":166,"props":2792,"children":2793},{"style":185},[2794],{"type":25,"value":2717},{"type":20,"tag":166,"props":2796,"children":2797},{"style":586},[2798],{"type":25,"value":2722},{"type":20,"tag":166,"props":2800,"children":2801},{"style":185},[2802],{"type":25,"value":593},{"type":20,"tag":166,"props":2804,"children":2805},{"style":751},[2806],{"type":25,"value":754},{"type":20,"tag":166,"props":2808,"children":2809},{"style":757},[2810],{"type":25,"value":2811},"a10:",{"type":20,"tag":166,"props":2813,"children":2814},{"style":751},[2815],{"type":25,"value":754},{"type":20,"tag":166,"props":2817,"children":2818},{"style":185},[2819],{"type":25,"value":1426},{"type":20,"tag":166,"props":2821,"children":2822},{"style":751},[2823],{"type":25,"value":754},{"type":20,"tag":166,"props":2825,"children":2826},{"style":757},[2827],{"type":25,"value":2828},"atom:",{"type":20,"tag":166,"props":2830,"children":2831},{"style":751},[2832],{"type":25,"value":754},{"type":20,"tag":166,"props":2834,"children":2835},{"style":185},[2836],{"type":25,"value":769},{"type":20,"tag":166,"props":2838,"children":2839},{"class":168,"line":1099},[2840],{"type":20,"tag":166,"props":2841,"children":2842},{"emptyLinePlaceholder":338},[2843],{"type":25,"value":341},{"type":20,"tag":166,"props":2845,"children":2846},{"class":168,"line":1108},[2847,2851,2855,2859,2863,2867,2871,2875,2880,2884,2888],{"type":20,"tag":166,"props":2848,"children":2849},{"style":185},[2850],{"type":25,"value":2011},{"type":20,"tag":166,"props":2852,"children":2853},{"style":626},[2854],{"type":25,"value":806},{"type":20,"tag":166,"props":2856,"children":2857},{"style":185},[2858],{"type":25,"value":205},{"type":20,"tag":166,"props":2860,"children":2861},{"style":626},[2862],{"type":25,"value":815},{"type":20,"tag":166,"props":2864,"children":2865},{"style":185},[2866],{"type":25,"value":205},{"type":20,"tag":166,"props":2868,"children":2869},{"style":626},[2870],{"type":25,"value":1031},{"type":20,"tag":166,"props":2872,"children":2873},{"style":185},[2874],{"type":25,"value":205},{"type":20,"tag":166,"props":2876,"children":2877},{"style":586},[2878],{"type":25,"value":2879},"Write",{"type":20,"tag":166,"props":2881,"children":2882},{"style":185},[2883],{"type":25,"value":2459},{"type":20,"tag":166,"props":2885,"children":2886},{"style":586},[2887],{"type":25,"value":2464},{"type":20,"tag":166,"props":2889,"children":2890},{"style":185},[2891],{"type":25,"value":2469},{"type":20,"tag":166,"props":2893,"children":2894},{"class":168,"line":1116},[2895],{"type":20,"tag":166,"props":2896,"children":2897},{"style":185},[2898],{"type":25,"value":567},{"type":20,"tag":166,"props":2900,"children":2901},{"class":168,"line":1125},[2902],{"type":20,"tag":166,"props":2903,"children":2904},{"emptyLinePlaceholder":338},[2905],{"type":25,"value":341},{"type":20,"tag":166,"props":2907,"children":2909},{"class":168,"line":2908},42,[2910,2914,2919,2923,2928,2932,2937,2942,2946,2951,2956],{"type":20,"tag":166,"props":2911,"children":2912},{"style":381},[2913],{"type":25,"value":502},{"type":20,"tag":166,"props":2915,"children":2916},{"style":381},[2917],{"type":25,"value":2918}," static",{"type":20,"tag":166,"props":2920,"children":2921},{"style":433},[2922],{"type":25,"value":672},{"type":20,"tag":166,"props":2924,"children":2925},{"style":586},[2926],{"type":25,"value":2927}," VerifyCdataHtmlEncoding",{"type":20,"tag":166,"props":2929,"children":2930},{"style":185},[2931],{"type":25,"value":593},{"type":20,"tag":166,"props":2933,"children":2934},{"style":403},[2935],{"type":25,"value":2936},"StringBuilder",{"type":20,"tag":166,"props":2938,"children":2939},{"style":601},[2940],{"type":25,"value":2941}," buffer",{"type":20,"tag":166,"props":2943,"children":2944},{"style":185},[2945],{"type":25,"value":1426},{"type":20,"tag":166,"props":2947,"children":2948},{"style":403},[2949],{"type":25,"value":2950},"XElement",{"type":20,"tag":166,"props":2952,"children":2953},{"style":601},[2954],{"type":25,"value":2955}," element",{"type":20,"tag":166,"props":2957,"children":2958},{"style":185},[2959],{"type":25,"value":609},{"type":20,"tag":166,"props":2961,"children":2963},{"class":168,"line":2962},43,[2964,2969,2974,2979,2983,2988,2992,2997],{"type":20,"tag":166,"props":2965,"children":2966},{"style":173},[2967],{"type":25,"value":2968},"        if",{"type":20,"tag":166,"props":2970,"children":2971},{"style":185},[2972],{"type":25,"value":2973},"(element.",{"type":20,"tag":166,"props":2975,"children":2976},{"style":626},[2977],{"type":25,"value":2978},"Value",{"type":20,"tag":166,"props":2980,"children":2981},{"style":185},[2982],{"type":25,"value":205},{"type":20,"tag":166,"props":2984,"children":2985},{"style":586},[2986],{"type":25,"value":2987},"Contains",{"type":20,"tag":166,"props":2989,"children":2990},{"style":185},[2991],{"type":25,"value":593},{"type":20,"tag":166,"props":2993,"children":2994},{"style":751},[2995],{"type":25,"value":2996},"\"\"",{"type":20,"tag":166,"props":2998,"children":2999},{"style":185},[3000],{"type":25,"value":1036},{"type":20,"tag":166,"props":3002,"children":3004},{"class":168,"line":3003},44,[3005,3010,3015,3019,3023,3027,3032,3036,3040,3045,3050,3054,3058,3062,3066],{"type":20,"tag":166,"props":3006,"children":3007},{"style":433},[3008],{"type":25,"value":3009},"            string",{"type":20,"tag":166,"props":3011,"children":3012},{"style":185},[3013],{"type":25,"value":3014}," cdataValue ",{"type":20,"tag":166,"props":3016,"children":3017},{"style":381},[3018],{"type":25,"value":796},{"type":20,"tag":166,"props":3020,"children":3021},{"style":433},[3022],{"type":25,"value":464},{"type":20,"tag":166,"props":3024,"children":3025},{"style":185},[3026],{"type":25,"value":205},{"type":20,"tag":166,"props":3028,"children":3029},{"style":586},[3030],{"type":25,"value":3031},"Format",{"type":20,"tag":166,"props":3033,"children":3034},{"style":185},[3035],{"type":25,"value":593},{"type":20,"tag":166,"props":3037,"children":3038},{"style":751},[3039],{"type":25,"value":2996},{"type":20,"tag":166,"props":3041,"children":3042},{"style":185},[3043],{"type":25,"value":3044},", element.",{"type":20,"tag":166,"props":3046,"children":3047},{"style":626},[3048],{"type":25,"value":3049},"Name",{"type":20,"tag":166,"props":3051,"children":3052},{"style":185},[3053],{"type":25,"value":3044},{"type":20,"tag":166,"props":3055,"children":3056},{"style":626},[3057],{"type":25,"value":2978},{"type":20,"tag":166,"props":3059,"children":3060},{"style":185},[3061],{"type":25,"value":3044},{"type":20,"tag":166,"props":3063,"children":3064},{"style":626},[3065],{"type":25,"value":3049},{"type":20,"tag":166,"props":3067,"children":3068},{"style":185},[3069],{"type":25,"value":769},{"type":20,"tag":166,"props":3071,"children":3073},{"class":168,"line":3072},45,[3074,3079,3083,3087,3091],{"type":20,"tag":166,"props":3075,"children":3076},{"style":185},[3077],{"type":25,"value":3078},"            buffer.",{"type":20,"tag":166,"props":3080,"children":3081},{"style":586},[3082],{"type":25,"value":2722},{"type":20,"tag":166,"props":3084,"children":3085},{"style":185},[3086],{"type":25,"value":2973},{"type":20,"tag":166,"props":3088,"children":3089},{"style":586},[3090],{"type":25,"value":2464},{"type":20,"tag":166,"props":3092,"children":3093},{"style":185},[3094],{"type":25,"value":3095},"(), cdataValue);\n",{"type":20,"tag":166,"props":3097,"children":3099},{"class":168,"line":3098},46,[3100],{"type":20,"tag":166,"props":3101,"children":3102},{"style":185},[3103],{"type":25,"value":1096},{"type":20,"tag":166,"props":3105,"children":3107},{"class":168,"line":3106},47,[3108],{"type":20,"tag":166,"props":3109,"children":3110},{"style":185},[3111],{"type":25,"value":567},{"type":20,"tag":166,"props":3113,"children":3115},{"class":168,"line":3114},48,[3116],{"type":20,"tag":166,"props":3117,"children":3118},{"style":185},[3119],{"type":25,"value":1131},{"type":20,"tag":1701,"props":3121,"children":3122},{},[3123],{"type":25,"value":1705},{"title":160,"searchDepth":191,"depth":191,"links":3125},[],"content:comments:creating-rss-feeds-in-asp-net-mvc:41330.md","comments/creating-rss-feeds-in-asp-net-mvc/41330.md","comments/creating-rss-feeds-in-asp-net-mvc/41330",{"_path":3130,"_dir":1732,"_draft":6,"_partial":6,"_locale":7,"title":3131,"description":3132,"id":3133,"name":3134,"email":3135,"avatar":3136,"date":3137,"body":3138,"_type":1708,"_id":3156,"_source":1710,"_file":3157,"_stem":3158,"_extension":1713},"/comments/creating-rss-feeds-in-asp-net-mvc/41310","41310","Hi Damien,\nThanks for the well written article, RSS is really the glue that holds a lot of services together, leveraging it is well worth while.",41310,"Jarrod N","jarrodn@gmail.com","https://www.gravatar.com/avatar/aa37be2b149d2ef1c15b76c37516f167?r=pg&d=retro","2010-04-28T22:08:33",{"type":17,"children":3139,"toc":3154},[3140,3144,3149],{"type":20,"tag":21,"props":3141,"children":3142},{},[3143],{"type":25,"value":3132},{"type":20,"tag":21,"props":3145,"children":3146},{},[3147],{"type":25,"value":3148},"On a side note, I was very happy to see your code using the \"Envy Code R\" font, I've switched to that recently and haven't looked back :)",{"type":20,"tag":21,"props":3150,"children":3151},{},[3152],{"type":25,"value":3153},"-Jarrod",{"title":160,"searchDepth":191,"depth":191,"links":3155},[],"content:comments:creating-rss-feeds-in-asp-net-mvc:41310.md","comments/creating-rss-feeds-in-asp-net-mvc/41310.md","comments/creating-rss-feeds-in-asp-net-mvc/41310",{"_path":3160,"_dir":1732,"_draft":6,"_partial":6,"_locale":7,"title":3161,"description":3162,"id":3163,"name":3164,"email":3165,"avatar":3166,"date":3167,"body":3168,"_type":1708,"_id":3185,"_source":1710,"_file":3186,"_stem":3187,"_extension":1713},"/comments/creating-rss-feeds-in-asp-net-mvc/41132","41132","That code makes me happy. I can't define good code, but I know it when I see it. Simple, extensible, testable, re-uses pre existing artwork that's baked into the framework, it ticks a whole lot of boxes. Nice work Mr Guard.",41132,"Dan F","dan@redgum.com.au","https://www.gravatar.com/avatar/3d629c7d5d080f9a20200db33f63bca0?r=pg&d=retro","2010-04-27T02:01:09",{"type":17,"children":3169,"toc":3183},[3170],{"type":20,"tag":21,"props":3171,"children":3172},{},[3173,3175,3181],{"type":25,"value":3174},"That code makes me happy. I can't define ",{"type":20,"tag":3176,"props":3177,"children":3178},"i",{},[3179],{"type":25,"value":3180},"good",{"type":25,"value":3182}," code, but I know it when I see it. Simple, extensible, testable, re-uses pre existing artwork that's baked into the framework, it ticks a whole lot of boxes. Nice work Mr Guard.",{"title":160,"searchDepth":191,"depth":191,"links":3184},[],"content:comments:creating-rss-feeds-in-asp-net-mvc:41132.md","comments/creating-rss-feeds-in-asp-net-mvc/41132.md","comments/creating-rss-feeds-in-asp-net-mvc/41132",1779264584258]