public async Task<List<ClassifiedModel>> GetRecentClassifieds(int blockSize) { using (var context7 = new SiteContext()) { var classifieds = context7.Classified.SqlQuery("Select Top " + blockSize + " * from " + Constants.SchemaName + " [Classifieds]" + "where CurrentStatus = " + Constants.ClassifiedItemAvailable + " order by LastUpdated desc"); return await classifieds.ToListAsync(); } }
public async Task<List<ThreadModel>> GetMostCommentedThreads(int num) { using (var context5 = new SiteContext()) { var rows = context5.Threads.SqlQuery("SELECT TOP " + num + " * FROM " + Constants.SchemaName + "[Threads]" + "ORDER BY Responses desc").ToListAsync(); return await rows; } }
public async Task<List<ThreadModel>> GetRecentRecordsAsync(int blockSize) { using (var context6 = new SiteContext()) { var model = context6.Threads.SqlQuery("Select Top " + blockSize + " * from " + Constants.SchemaName + " [Threads]" + "order by LastUpdated desc"); return await model.ToListAsync(); } }
public async Task<List<string>> GetTrendingTagsAnnouncementAsync() { using (var context2 = new SiteContext()) { var results = context2.Threads.GroupBy(x => x.TagsAnnouncement) .Select(grp => new { Name = grp.Key, Count = grp.Count() }) .OrderByDescending(x => x.Count); return await (from item in results where !String.IsNullOrEmpty(item.Name) select item.Name + " (" + item.Count + ") ").ToListAsync(); } }