Exemplo n.º 1
0
        public async Task <IActionResult> Get()
        {
            try
            {
                var posts = await _postServices.GetPostsAsync();

                await _hub.Clients.All.GetMessage(posts);

                return(Ok(posts));
            }
            catch (Exception e)
            {
                _logger.LogError(e, e.Message);
                return(BadRequest());
            }
        }
Exemplo n.º 2
0
 public async Task <IActionResult> GetAll()
 {
     return(Ok(await _postService.GetPostsAsync()));
 }
Exemplo n.º 3
0
        public async Task <IActionResult> GetAll()
        {
            var posts = await _postServices.GetPostsAsync();

            return(Ok(posts));
        }