Exemplo n.º 1
0
        public async Task <IActionResult> FindByEditora(string editora)
        {
            try
            {
                if (string.IsNullOrEmpty(editora))
                {
                    return(BadRequest("Editora não informada"));
                }

                var newlivros = await _livrobusiness.FindByEditora(editora);

                if (newlivros == null)
                {
                    return(NotFound("Editora não existente"));
                }
                return(Ok(newlivros));
            }
            catch (Exception e)
            {
                return(BadRequest($"{e.Message}"));
            }
        }