Datalist is one of most useful controls for creating image gallery and product details screen. If we use Datalist controls, then it will save lots of our development time. It has inbuilt paging functionalities.
Before using this code, please configure your project for Radzen Controls like this
Recently I got the chance to implement google RSS news on one of my Blazor Webassembly project. It is very simple to implement using System.ServiceModel.Syndication package
Step 1: Create the Class like
public class NewsItem
{
public string NewsTitle { get; set; } = "";
public string NewsLink { get; set; } = "";
public DateTime PubishDate { get; set; }
}
Step2: Create the Web API controller and write the method for reading RSS like this
[HttpGet("GetNewsFeedData")]
public List<NewsItem> GetNewsFeedData()
{
List<NewsItem> newsItems = new List<NewsItem>();
List<NewsItem> healthData = new List<NewsItem>();
string url = "https://news.google.com/rss/search?q=prescription+drugs&hl=en-US&gl=US&ceid=US:en";
newsItems = FetchRssFeedData(url);
string healthrssPath = "https://news.google.com/rss/search?q='health'";
healthData= FetchRssFeedData(healthrssPath);
var combineList = newsItems.Concat(healthData).ToList();
var result= (from m in combineList orderby m.PubishDate descending
select m).ToList();
return result;
}