Ejemplo n.º 1
0
        // GET api/credit
//        [Route("Get")]
        public IHttpActionResult Get([FromUri] int?page = null)
        {
            try
            {
                const int pageSize   = 10;
                var       pageNumber = page ?? 1;
                var       result     = Mapper.Map <CustomPagedList <ShortCredit> >(creditService.GetAll(pageNumber, pageSize));
                return(Ok(result));
            }
            catch (BankClientException ex)
            {
                return(BadRequest(ex.Message));
            }
            catch (Exception ex)
            {
                return(InternalServerError(ex));
            }
        }