Get C# Corner RSS Feeds In Blazor Project

We can see how to read RSS feeds from C# Corner site and display the feeds in a Blazor project. We will see how to get all posts feeds for an author (author id can be given by user), feeds for latest posts, feeds for featured articles and feeds for top read posts.

Overview

In this post, we will see how to read RSS feeds from the C# Corner website and display the feeds in a Blazor project. We will see how to get all post feeds for an author (author id can be given by the user), feeds for the latest posts, feeds for featured articles, and feeds for top-read posts.

RSS (originally RDF Site Summary; later, two approaches emerged, which used the acronyms “Rich Site Summary” and “Really Simple Syndication” respectively). It is a type of web feed which allows the users and applications to access updates to the online content of a website in a standardized, computer-readable format.
  
Blazor is an experimental .NET web framework using C#/Razor and HTML that runs in the browser with WebAssembly. Blazor provides all the benefits of a client-side web UI framework using .NET on the client and optionally, on the server.
 
I have already written many articles on Blazor in C# Corner. If you are new to Blazor, please refer to the below articles to get started with Blazor.

Create a Blazor project in Visual Studio

Create a new Blazor project in Visual Studio. I am using the free community edition of Visual Studio 2017.

Choose .NET Core -> ASP.NET Core Web Application template.
 
Get C# Corner RSS Feeds in Blazor Project  
 
Currently, Blazor supports three different templates. We will choose “Blazor (ASP.NET Core hosted)” template for our project.
 
Get C# Corner RSS Feeds in Blazor Project
 
Our solution will be ready in a few moments. Please note that there are three projects created in our solution - “Client”, “Server”, and “Shared”.
 
Get C# Corner RSS Feeds in Blazor Project

By default, Blazor created many files in these three projects. We can remove all the unwanted files like “Counter.cshtml”, “FetchData.cshtml”, “SurveyPrompt.cshtml” from Client project and “SampleDataController.cs” file from Server project and remove WeatherForecast.cs” file from shared project too.

Create a new “Models” folder in “Shared” project and add a “Feed” class file inside this folder. We will add two classes “AuthorPosts” and “Feed” in this file.
 
Feed.cs
  1. using System;  
  2. using System.Collections.Generic;  
  3.   
  4. namespace CsharpCornerRSSBlazor.Shared.Models  
  5. {  
  6.     public class AuthorPosts  
  7.     {  
  8.         public string AuthorName { getset; }  
  9.         public IEnumerable<Feed> Feeds { getset; }  
  10.     }  
  11.     public class Feed  
  12.     {  
  13.         public string Link { getset; }  
  14.         public string Title { getset; }  
  15.         public string FeedType { getset; }  
  16.         public string Author { getset; }  
  17.         public string Content { getset; }  
  18.         public DateTime PubDate { getset; }  
  19.         public string PublishDate { getset; }  
  20.   
  21.         public Feed()  
  22.         {  
  23.             Link = "";  
  24.             Title = "";  
  25.             FeedType = "";  
  26.             Author = "";  
  27.             Content = "";  
  28.             PubDate = DateTime.Today;  
  29.             PublishDate = DateTime.Today.ToString("dd-MMM-yyyy");  
  30.         }  
  31.     }  
  32. }  

In “Feed” class, we have defined all the properties for RSS feeds such as “Link”, “Title”, “FeedType”, “Author”, “Content”, “PubDate” and “PublishDate”.

PublishDate” is a string property which is also used for keeping post published date but will be converted to a string format (“dd-MMM-yyyy"). Mainly I added this additional property to avoid the confusion over different date formats used in various countries.

In “AuthorPost” class, we keep “AuthorName” and array of feeds for a given author.
 

Create an API controller in “Server” project

 
Get C# Corner RSS Feeds in Blazor Project

We can add code for getting all posts for a given author.

Code for "All Posts" for a given author.
  1. readonly CultureInfo culture = new CultureInfo("en-US");  
  2.   
  3.        [Route("allposts/{authorId}")]  
  4.        [HttpGet]  
  5.        public AuthorPosts AllPosts(string authorId)  
  6.        {  
  7.            AuthorPosts authorPosts = new AuthorPosts();  
  8.            try  
  9.            {  
  10.                XDocument doc = XDocument.Load("https://www.c-sharpcorner.com/members/" + authorId + "/rss");  
  11.                var entries = from item in doc.Root.Descendants().First(i => i.Name.LocalName == "channel").Elements().Where(i => 
  12.                               i.Name.LocalName == "item")  
  13.                              select new Feed  
  14.                              {  
  15.                                  Content = item.Elements().First(i => i.Name.LocalName == "description").Value,  
  16.                                  Link = (item.Elements().First(i => i.Name.LocalName == "link").Value).StartsWith("/") ? "https://www.c-sharpcorner.com" + item.Elements().First(i => i.Name.LocalName == "link").Value : item.Elements().First(i => i.Name.LocalName == "link").Value,  
  17.                                  PubDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture),  
  18.                                  PublishDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture).ToString("dd-MMM-yyyy"),  
  19.                                  Title = item.Elements().First(i => i.Name.LocalName == "title").Value,  
  20.                                  FeedType = (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("blog") ? "Blog" : (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("news") ? "News" : "Article",  
  21.                                  Author = item.Elements().First(i => i.Name.LocalName == "author").Value  
  22.                              };  
  23.   
  24.                authorPosts.AuthorName = entries.FirstOrDefault().Author;  
  25.                authorPosts.Feeds = entries.OrderByDescending(o => o.PubDate);  
  26.                return authorPosts;  
  27.            }  
  28.            catch  
  29.            {  
  30.                authorPosts.AuthorName = "NOT FOUND!";  
  31.                List<Feed> feeds = new List<Feed>();  
  32.                Feed feed = new Feed();  
  33.                feeds.Add(feed);  
  34.                authorPosts.Feeds = feeds;  
  35.                return authorPosts;  
  36.            }  
  37.        }  

We have passed the author id as a parameter. Currently, C# Corner returns “links” for “Blogs” without a full URL. So, I added a ternary operator to add the full URL for blog posts. I have also checked the “link” value to differentiate post type as “Articles”, “Blogs” and “News”

Code for Latest Posts
  1. [Route("latestposts")]  
  2.         [HttpGet]  
  3.         public IEnumerable<Feed> LatestPosts()  
  4.         {  
  5.             try  
  6.             {  
  7.                 XDocument doc = XDocument.Load("https://www.c-sharpcorner.com/rss/latestcontentall.aspx");  
  8.                 var entries = from item in doc.Root.Descendants().First(i => i.Name.LocalName == "channel").Elements().Where(i => i.Name.LocalName == "item")  
  9.                               select new Feed  
  10.                               {  
  11.                                   Content = item.Elements().First(i => i.Name.LocalName == "description").Value,  
  12.                                   Link = (item.Elements().First(i => i.Name.LocalName == "link").Value).StartsWith("/") ? "https://www.c-sharpcorner.com" + item.Elements().First(i => i.Name.LocalName == "link").Value : item.Elements().First(i => i.Name.LocalName == "link").Value,  
  13.                                   PubDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture),  
  14.                                   PublishDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture).ToString("dd-MMM-yyyy"),  
  15.                                   Title = item.Elements().First(i => i.Name.LocalName == "title").Value,  
  16.                                   FeedType = (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("blog") ? "Blog" : (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("news") ? "News" : "Article",  
  17.                                   Author = item.Elements().First(i => i.Name.LocalName == "author").Value  
  18.                               };  
  19.   
  20.                 return entries.OrderByDescending(o => o.PubDate);  
  21.             }  
  22.             catch  
  23.             {  
  24.                 List<Feed> feeds = new List<Feed>();  
  25.                 Feed feed = new Feed();  
  26.                 feeds.Add(feed);  
  27.                 return feeds;  
  28.             }  
  29.         }  

The only difference in this method from the previous method is, here we gave the RSS feed URL statically.

Code for Featured Posts
  1. [Route("featuredposts")]  
  2.        [HttpGet]  
  3.        public IEnumerable<Feed> FeaturedPosts()  
  4.        {  
  5.            try  
  6.            {  
  7.                XDocument doc = XDocument.Load("https://www.c-sharpcorner.com/rss/featuredarticles.aspx");  
  8.                var entries = from item in doc.Root.Descendants().First(i => i.Name.LocalName == "channel").Elements().Where(i => i.Name.LocalName == "item")  
  9.                              select new Feed  
  10.                              {  
  11.                                  Content = item.Elements().First(i => i.Name.LocalName == "description").Value,  
  12.                                  Link = (item.Elements().First(i => i.Name.LocalName == "link").Value).StartsWith("/") ? "https://www.c-sharpcorner.com" + item.Elements().First(i => i.Name.LocalName == "link").Value : item.Elements().First(i => i.Name.LocalName == "link").Value,  
  13.                                  PubDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture),  
  14.                                  PublishDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture).ToString("dd-MMM-yyyy"),  
  15.                                  Title = item.Elements().First(i => i.Name.LocalName == "title").Value,  
  16.                                  FeedType = (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("blog") ? "Blog" : (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("news") ? "News" : "Article",  
  17.                                  Author = item.Elements().First(i => i.Name.LocalName == "author").Value  
  18.                              };  
  19.   
  20.                return entries.OrderByDescending(o => o.PubDate);  
  21.            }  
  22.            catch  
  23.            {  
  24.                List<Feed> feeds = new List<Feed>();  
  25.                Feed feed = new Feed();  
  26.                feeds.Add(feed);  
  27.                return feeds;  
  28.            }  
  29.        }  

This is the same as the previous method, the only difference is the RSS feed URL.

Code for Top Read Posts

  1. [Route("topposts")]  
  2.        [HttpGet]  
  3.        public IEnumerable<Feed> TrendingPosts()  
  4.        {  
  5.            try  
  6.            {  
  7.                XDocument doc = XDocument.Load("https://www.c-sharpcorner.com/rss/toparticles.aspx");  
  8.                var entries = from item in doc.Root.Descendants().First(i => i.Name.LocalName == "channel").Elements().Where(i => i.Name.LocalName == "item")  
  9.                              select new Feed  
  10.                              {  
  11.                                  Content = item.Elements().First(i => i.Name.LocalName == "description").Value,  
  12.                                  Link = (item.Elements().First(i => i.Name.LocalName == "link").Value).StartsWith("/") ? "https://www.c-sharpcorner.com" + item.Elements().First(i => i.Name.LocalName == "link").Value : item.Elements().First(i => i.Name.LocalName == "link").Value,  
  13.                                  PubDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture),  
  14.                                  PublishDate = Convert.ToDateTime(item.Elements().First(i => i.Name.LocalName == "pubDate").Value, culture).ToString("dd-MMM-yyyy"),  
  15.                                  Title = item.Elements().First(i => i.Name.LocalName == "title").Value,  
  16.                                  FeedType = (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("blog") ? "Blog" : (item.Elements().First(i => i.Name.LocalName == "link").Value).ToLowerInvariant().Contains("news") ? "News" : "Article",  
  17.                                  Author = item.Elements().First(i => i.Name.LocalName == "author").Value  
  18.                              };  
  19.   
  20.                return entries;  
  21.            }  
  22.            catch  
  23.            {  
  24.                List<Feed> feeds = new List<Feed>();  
  25.                Feed feed = new Feed();  
  26.                feeds.Add(feed);  
  27.                return feeds;  
  28.            }  
  29.        }  

This is also the same as the previous method, the only difference is the RSS feed URL.

We have added all the source code for the Controller class. Now, we can go to the “Client” project and modify the “NavMenu.cshtml” Razor view inside the “Shared” folder. This Razor view will be used for navigating the menu items.

NavMenu.cshtml
  1. <div class="top-row pl-4 navbar navbar-dark">  
  2.     <a class="navbar-brand" href="">C# Corner RSS Blazor App</a>  
  3.     <button class="navbar-toggler" onclick=@ToggleNavMenu>  
  4.         <span class="navbar-toggler-icon"></span>  
  5.     </button>  
  6. </div>  
  7.   
  8. <div class=@(collapseNavMenu ? "collapse" : null) onclick=@ToggleNavMenu>  
  9.     <ul class="nav flex-column">  
  10.         <li class="nav-item px-3">  
  11.             <NavLink class="nav-link" href="" Match=NavLinkMatch.All>  
  12.                 <span class="oi oi-home" aria-hidden="true"></span> Home  
  13.             </NavLink>  
  14.         </li>  
  15.         <li class="nav-item px-3">  
  16.             <NavLink class="nav-link" href="/allposts">  
  17.                 <span class="oi oi-list-rich" aria-hidden="true"></span> All Posts by an Author  
  18.             </NavLink>  
  19.         </li>  
  20.         <li class="nav-item px-3">  
  21.             <NavLink class="nav-link" href="/latestposts">  
  22.                 <span class="oi oi-list-rich" aria-hidden="true"></span> Latest Posts  
  23.             </NavLink>  
  24.         </li>  
  25.         <li class="nav-item px-3">  
  26.             <NavLink class="nav-link" href="/featuredposts">  
  27.                 <span class="oi oi-list-rich" aria-hidden="true"></span> Featured Posts  
  28.             </NavLink>  
  29.         </li>  
  30.         <li class="nav-item px-3">  
  31.             <NavLink class="nav-link" href="/topposts">  
  32.                 <span class="oi oi-list-rich" aria-hidden="true"></span> Top Read Posts  
  33.             </NavLink>  
  34.         </li>  
  35.     </ul>  
  36. </div>  
  37.   
  38. @functions {  
  39. bool collapseNavMenu = true;  
  40.   
  41. void ToggleNavMenu()  
  42. {  
  43.     collapseNavMenu = !collapseNavMenu;  
  44. }  
  45. }  

We can add a new Razor view under “Pages” folder for showing the feeds for a given author.

Get C# Corner RSS Feeds in Blazor Project
 
AllPosts.cshtml
  1. @using CsharpCornerRSSBlazor.Shared.Models  
  2. @page "/allposts"  
  3. @inject HttpClient Http  
  4.   
  5. <h4>C# Corner All Post Details by an Author</h4>  
  6.   
  7. <input placeholder="Enter Author Id" bind="@authorId" />  
  8.   
  9. <input type="button" class="btn btn-default" onclick="@(async () => await GetAllPosts())" value="Get Posts" />  
  10. <br />  
  11. <br />  
  12. <p><b>@author</b></p>  
  13.   
  14.   
  15. @if (feeds == null)  
  16. {  
  17.     if (!pageLoaded && authorId != "" && author != "Invalid Author Id!")  
  18.     {  
  19.         <p><em>Loading...</em></p>  
  20.     }  
  21. }  
  22. else  
  23. {  
  24.     if (!author.ToUpperInvariant().Contains("NOT FOUND"))  
  25.     {  
  26.         counter = 0;  
  27.         <table class='table'>  
  28.             <thead>  
  29.                 <tr>  
  30.                     <th>Sl.No.</th>  
  31.                     <th>Post Title (With Link)</th>  
  32.                     <th>Post Type</th>  
  33.                     <th>Content</th>  
  34.                     <th>Publish Date</th>  
  35.                 </tr>  
  36.             </thead>  
  37.             <tbody>  
  38.                 @foreach (var feed in feeds)  
  39.                 {  
  40.                     counter++;  
  41.                     <tr>  
  42.                         <td>@counter</td>  
  43.                         <td><NavLink href=@feed.Link target="_blank">@feed.Title</NavLink></td>  
  44.                         <td>@feed.FeedType</td>  
  45.                         <td>@feed.Content</td>  
  46.                         <td>@feed.PublishDate</td>  
  47.                     </tr>  
  48.                 }  
  49.             </tbody>  
  50.         </table>  
  51.     }  
  52. }  
  53. @functions {  
  54. Feed[] feeds;  
  55. AuthorPosts authorPosts;  
  56. string authorId;  
  57. bool pageLoaded;  
  58. int counter;  
  59. string author;  
  60.   
  61. protected override void OnInit()  
  62. {  
  63.     authorId = "";  
  64.     pageLoaded = true;  
  65.     author = "";  
  66. }  
  67.   
  68. protected async Task GetAllPosts()  
  69. {  
  70.     author = "";  
  71.     pageLoaded = false;  
  72.     feeds = null;  
  73.     if (authorId != "")  
  74.     {  
  75.         authorPosts = await Http.GetJsonAsync<AuthorPosts>("/api/feeds/allposts/" + authorId);  
  76.         if (authorPosts != null)  
  77.         {  
  78.             if (authorPosts.AuthorName.ToUpperInvariant().Contains("NOT FOUND"))  
  79.             {  
  80.                 author = "Invalid Author Id!";  
  81.             }  
  82.             else  
  83.             {  
  84.                 author = "Author Name : " + authorPosts.AuthorName;  
  85.                 feeds = authorPosts.Feeds.ToArray();  
  86.             }  
  87.         }  
  88.     }  
  89.     else  
  90.     {  
  91.         author = "Author Id should not be blank";  
  92.     }  
  93. }  
  94. }      

I have created an input text field to get the author id and after hitting the “Get Posts” button, “GetAllPosts” method will be triggered and if the given author id has any data available, it will be displayed in the HTML table. Otherwise, “Invalid Author Id” notification will be displayed on the screen.

We can create another Razor view for getting the latest post details.
 
LatestPosts.cshtml
  1. @using CsharpCornerRSSBlazor.Shared.Models  
  2. @page "/latestposts"  
  3. @inject HttpClient Http  
  4.   
  5. <h4>C# Corner Latest Posts</h4>  
  6.   
  7. @if (feeds == null)  
  8. {  
  9.     <p><em>Loading...</em></p>  
  10. }  
  11. else  
  12. {  
  13.     counter = 0;  
  14.     <table class='table'>  
  15.         <thead>  
  16.             <tr>  
  17.                 <th>Sl.No.</th>  
  18.                 <th>Post Title (With Link)</th>  
  19.                 <th>Post Type</th>  
  20.                 <th>Content</th>  
  21.                 <th>Publish Date</th>  
  22.                 <th>Author</th>  
  23.             </tr>  
  24.         </thead>  
  25.         <tbody>  
  26.             @foreach (var feed in feeds)  
  27.             {  
  28.                 counter++;  
  29.                 <tr>  
  30.                     <td>@counter</td>  
  31.                     <td><NavLink href=@feed.Link target="_blank">@feed.Title</NavLink></td>  
  32.                     <td>@feed.FeedType</td>  
  33.                     <td>@feed.Content</td>  
  34.                     <td>@feed.PublishDate</td>  
  35.                     <td>@feed.Author</td>  
  36.                 </tr>  
  37.             }  
  38.         </tbody>  
  39.     </table>  
  40. }  
  41. @functions {  
  42. Feed[] feeds;  
  43. int counter;  
  44.   
  45. protected override async Task OnInitAsync()  
  46. {  
  47.     feeds = null;  
  48.     feeds = await Http.GetJsonAsync<Feed[]>("/api/feeds/latestposts");  
  49. }  
  50.   
  51. }      

In this file we have displayed all the latest article details. Please note that currently C# corner returns only 100 top posts in RSS feeds.

We can create another Razor view for getting featured post details.
 
FeaturedPosts.cshtml
  1. @using CsharpCornerRSSBlazor.Shared.Models  
  2. @page "/featuredposts"  
  3. @inject HttpClient Http  
  4.   
  5. <h4>C# Corner Featured Post Details</h4>  
  6.   
  7. @if (feeds == null)  
  8. {  
  9.     <p><em>Loading...</em></p>  
  10. }  
  11. else  
  12. {  
  13.     counter = 0;  
  14.     <table class='table'>  
  15.         <thead>  
  16.             <tr>  
  17.                 <th>Sl.No.</th>  
  18.                 <th>Post Title (With Link)</th>  
  19.                 <th>Post Type</th>  
  20.                 <th>Content</th>  
  21.                 <th>Publish Date</th>  
  22.                 <th>Author</th>  
  23.             </tr>  
  24.         </thead>  
  25.         <tbody>  
  26.             @foreach (var feed in feeds)  
  27.             {  
  28.                 counter++;  
  29.                 <tr>  
  30.                     <td>@counter</td>  
  31.                     <td><NavLink href=@feed.Link target="_blank">@feed.Title</NavLink></td>  
  32.                     <td>@feed.FeedType</td>  
  33.                     <td>@feed.Content</td>  
  34.                     <td>@feed.PublishDate</td>  
  35.                     <td>@feed.Author</td>  
  36.                 </tr>  
  37.             }  
  38.         </tbody>  
  39.     </table>  
  40. }  
  41. @functions {  
  42. Feed[] feeds;  
  43. int counter;  
  44.   
  45. protected override async Task OnInitAsync()  
  46. {  
  47.     feeds = null;  
  48.     feeds = await Http.GetJsonAsync<Feed[]>("/api/feeds/featuredposts");  
  49. }  
  50.   
  51. }      

We can add one more Razor View for getting the top read post details.

TopPosts.cshtml
  1. @using CsharpCornerRSSBlazor.Shared.Models  
  2. @page "/topposts"  
  3. @inject HttpClient Http  
  4.   
  5. <h4>C# Corner Top Read Posts</h4>  
  6.   
  7. @if (feeds == null)  
  8. {  
  9.     <p><em>Loading...</em></p>  
  10. }  
  11. else  
  12. {  
  13.     counter = 0;  
  14.     <table class='table'>  
  15.         <thead>  
  16.             <tr>  
  17.                 <th>Sl.No.</th>  
  18.                 <th>Post Title (With Link)</th>  
  19.                 <th>Post Type</th>  
  20.                 <th>Content</th>  
  21.                 <th>Publish Date</th>  
  22.                 <th>Author</th>  
  23.             </tr>  
  24.         </thead>  
  25.         <tbody>  
  26.             @foreach (var feed in feeds)  
  27.             {  
  28.                 counter++;  
  29.                 <tr>  
  30.                     <td>@counter</td>  
  31.                     <td><NavLink href=@feed.Link target="_blank">@feed.Title</NavLink></td>  
  32.                     <td>@feed.FeedType</td>  
  33.                     <td>@feed.Content</td>  
  34.                     <td>@feed.PublishDate</td>  
  35.                     <td>@feed.Author</td>  
  36.                 </tr>  
  37.             }  
  38.         </tbody>  
  39.     </table>  
  40. }  
  41. @functions {  
  42. Feed[] feeds;  
  43. int counter;  
  44.   
  45. protected override async Task OnInitAsync()  
  46. {  
  47.     feeds = null;  
  48.     feeds = await Http.GetJsonAsync<Feed[]>("/api/feeds/topposts");  
  49. }  
  50.   
  51. }      

We can modify the “Index.cshtml” Razor View also.

Index.cshtml

  1. @page "/"  
  2.   
  3. <h3>Get C# Corner RSS Feeds in Blazor Project </h3>  
  4. <hr />  
  5. <p>  
  6.     We can see how to read RSS feeds from C# Corner site and display the feeds in a Blazor project.   
  7.     We will see how to get all posts feeds for an author (author id can be given by user),   
  8.     feeds for latest posts, feeds for featured articles and feeds for top read posts.  
  9. </p>  

We have completed all the coding part. We can now run the application. The home page will look like the below image.

Get C# Corner RSS Feeds in Blazor Project
 
We can click the “All Posts by an Author” link.
 
Get C# Corner RSS Feeds in Blazor Project
It will ask the user to enter an author id and click “Get Posts” button.
 
I have given my own author id. Now we have got all my post details.
 
Get C# Corner RSS Feeds in Blazor Project

Please note, post title will be mapped with post link. So, if we click the title, we can open the post in a new tab.

If you give an invalid author id, it will display the below message.
 
Get C# Corner RSS Feeds in Blazor Project
We can click the “Latest Posts” link in the navigation menu to get all the latest post details.
 
Get C# Corner RSS Feeds in Blazor Project

I have taken these details on November 18. It will display all the posts in date wise descending order.

We can click the “Featured Posts” link to get all the featured article details.
 
Get C# Corner RSS Feeds in Blazor Project
 
We can get the top-read post details by clicking the “Top Read Posts” link in the navigation menu.
 
Get C# Corner RSS Feeds in Blazor Project
 
Please note, this is not in date wise order. Instead, it's listed in the order of the user-read count. (Top read count posts come first.)
 

Deploy Blazor application on Azure

If you want to check this simple application, I have hosted the Blazor app on Azure as a Web App. Please click this URL to run the application.

Conclusion

In this post, we have seen how to get RSS feeds from C# Corner site and display this data in a Blazor project. We have got all the post details for a given author. We have also seen how to get RSS feeds for latest posts, featured posts and top read posts.

We will discuss more features of the Blazor framework in upcoming posts.