public IList<TagWithCount> GetTagList()
{
var query=(from c in this.Query() where c.coupons.Where(d => d.isPublish == true).Count() > 2 select new TagWithCount { tag = c, count = c.coupons.Count }).ToList().OrderBy(x => Guid.NewGuid()).Skip(0).Take(75).ToList();
return query;
}
这是我正在调用的方法..
var a = context.tagService.GetTagList().Distinct(c => c.tag.name.Trim()).ToList() ;
return View(a.Take(20));
我想返回 20 个标签,但不超过 20 个字或少于 4 个