public async Task <ActionResult> GetAll([FromServices] IAtividadeService service) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { return(Ok(await _service.GetAll())); } catch (ArgumentException e) { return(StatusCode((int)HttpStatusCode.InternalServerError, e.Message)); } }