Exemplo n.º 1
0
        public ActionResult <IEnumerable <PostReadDto> > GetAllPost()
        {
            IEnumerable <Post> posts = _repository.GetAllPost();

            if (posts != null)
            {
                return(Ok(_mapper.Map <IEnumerable <PostReadDto> >(posts)));
            }
            return(NotFound());
        }