protected Response ExecCmd() { Response resp; List <Listing> ret = Listing.GetListingByCategory(category, sortBy, isAsc); if (ret.Count == 0) { resp = new Response(false, outputErrCategoryNotFound); return(resp); } string outputS = ""; foreach (Listing item in ret) { outputS += item.ToString() + "\n"; } resp = new Response(true, outputS.Substring(0, outputS.Length - 1)); return(resp); }