Sort list by post date
I was able to resolve this by doing the following.List<Models.News> SortedList = articles.OrderByDescending(o => o.posDate).ToList(); Return SortedList;
View ArticleSort list by post date
I got an error message saying:'System.Linq.IQueryable<API.Models.News>'does not contain a definition for 'Sort' and no extension method 'Sort' accepting a first argument of type...
View ArticleSort list by post date
Just add the orderby keyword right in the Linq statement:var articles =fromnewin _context.nm_tbl_news join ncte in _context.nm_tbl_news_cts on news.ID equals ncte.fldNEWS_ID join cte in...
View ArticleSort list by post date
Hi MaddTechWF,You could do some thing like this,article.Sort((x,y) => x.posDate.CompareTo(y.posDate));Hope this helps you.Thanks, Sabah Shariq [If a post helps to resolve your issue, please click...
View ArticleSort list by post date
I have the following code and I need to sort the data by the posDate with the newest at the top.using System; using System.Collections.Generic; using System.Linq; using System.Net; using...
View Article
More Pages to Explore .....