예제 #1
0
        public async Task <IActionResult> list()
        {
            try
            {
                var list   = new List <IdeasVM>();
                var result = _IdeaService.GetAll();
                if (result != null)
                {
                    foreach (var item in result)
                    {
                        //Todo, put your mapping implementation here
                    }

                    return(this.Ok(await Task.FromResult(list)));
                }

                return(NotFound());
            }
            catch (Exception xcp)
            {
                //log error
                return(Ok(Enumerable.Empty <IdeasVM> ().AsQueryable()));
            }
        }
예제 #2
0
        public async Task <IActionResult> GetAll(PagingParameters pagingParameters)
        {
            List <Idea> ideas = await _ideaService.GetAll(pagingParameters);

            return(Success(ideas.MapList(IdeaModelMapper.MapToIdeaResponseViewModel)));
        }
예제 #3
0
 public ActionResult GetAll()
 {
     return(new OkObjectResult(_service.GetAll()));
 }