Exemple #1
0
        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"));
        }
Exemple #2
0
        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));
        }