Example #1
0
        public IHttpActionResult GetAll()
        {
            ResponseDataDTO <IEnumerable <source> > response = new ResponseDataDTO <IEnumerable <source> >();

            try
            {
                response.Code    = HttpCode.OK;
                response.Message = MessageResponse.SUCCESS;
                response.Data    = _sourceservice.GetAll();
            }
            catch (Exception ex)
            {
                response.Code    = HttpCode.INTERNAL_SERVER_ERROR;
                response.Message = ex.Message;
                response.Data    = null;

                Console.WriteLine(ex.ToString());
            }

            return(Ok(response));
        }
Example #2
0
        public ActionResult <List <SourceDto> > GetAll()
        {
            var sources = _sourceService.GetAll();

            return(new OkObjectResult(_mapper.Map <List <SourceDto> >(sources)));
        }