public ContentResult Cities(string q, int limit, Int64 timestamp) { StringBuilder responseContentBuilder = new StringBuilder(); LocationAction objLoc = new LocationAction(); IList<City> lstCity = objLoc.GetAllCities(q).OrderBy(x => x.Region.code).ToList(); foreach (City city in lstCity) responseContentBuilder.Append(String.Format("{0}|{1}|{2}\n", city.id, city.Region.code, city.name)); return Content(responseContentBuilder.ToString()); }
public ContentResult SearchHelp(string q, int limit, Int64 timestamp) { #region StringBuilder responseContentBuilder = new StringBuilder(); CategoryAction objCat = new CategoryAction(); StreamAction objStream = new StreamAction(); LocationAction objLocation = new LocationAction(); IList<Category> lstCat = objCat.GetAllCategoriesByName(q).OrderBy(x => x.name).ToList(); IList<Member> lstMember = objStream.GetAllMembersByName(q).OrderBy(x => x.firstName).ToList(); IList<City> lstCity = objLocation.GetAllCities(q).OrderBy(x => x.name).ToList(); foreach (Category cat in lstCat) responseContentBuilder.Append(String.Format("{0}|{1}\n", cat.id, cat.name)); foreach (Member mem in lstMember) responseContentBuilder.Append(String.Format("{0}|{1}\n", mem.id, mem.firstName)); foreach (City ct in lstCity) responseContentBuilder.Append(String.Format("{0}|{1}\n", ct.id, ct.name)); return Content(responseContentBuilder.ToString()); #endregion }