public HttpResponseMessage tags() { var results = _tagobj.GetAll(); if (results != null) { results = results.OrderBy(o => o.tagname).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, new { data = results })); } return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No records found")); }
public ActionResult GetAll() { var results = _mainobj.GetAll(); if (results != null) { results = results.OrderBy(o => o.tagname).ToList(); return(Json(new { data = results }, JsonRequestBehavior.AllowGet)); } return(Json(new { data = new string[] { } }, JsonRequestBehavior.AllowGet)); }