public ContentResult Titles(string q, int limit, Int64 timestamp) { StringBuilder responseContentBuilder = new StringBuilder(); SeedAction objSeed = new SeedAction(); IList<Seed> finalList = new List<Seed>(); IList<Seed> lstSeed = objSeed.GetAllSeedsByTitle(q).OrderBy(x => x.title).ToList(); foreach (Seed s in lstSeed) { finalList.Add(s); } foreach (Seed seed in finalList) responseContentBuilder.Append(String.Format("{0}|{1}\n", seed.id, seed.title)); IList<Tag> lstTags = (from t in objSeed.GetAllTagsByName(q) group t by new { t.name } into g select new Tag { name = g.Key.name }).ToList(); foreach (Tag tag in lstTags) responseContentBuilder.Append(String.Format("{0}|{1}\n", tag.id, tag.name)); return Content(responseContentBuilder.ToString()); }
public ContentResult Tags(string q, int limit, Int64 timestamp) { StringBuilder responseContentBuilder = new StringBuilder(); SeedAction objSeed = new SeedAction(); IList<Tag> lstTags = (from t in objSeed.GetAllTagsByName(q) group t by new { t.name } into g select new Tag { name = g.Key.name }).ToList(); foreach (Tag tag in lstTags) responseContentBuilder.Append(String.Format("{0}|{1}\n", tag.id, tag.name)); return Content(responseContentBuilder.ToString()); }