Пример #1
0
        public HttpResponseMessage Get(int page = 10, int pageSize = 20)
        {
            var service = new LinksService(HttpContextHelper.LinkShortenContext);

            try
            {
                var result = service.GetLinks(page, pageSize);
                return(this.Request.CreateResponse(HttpStatusCode.OK, result));
            } catch (Exception ex)
            {
                return(this.Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }
Пример #2
0
        // GET: Groups
        public ActionResult Index()
        {
            var links = linksService.GetLinks();

            return(View(links));
        }