Beispiel #1
0
        public IActionResult Get()
        {
            try
            {
                var newsletters = _newsletterRepository.Listar();

                if (newsletters.Count == 0)
                {
                    return(NoContent());
                }

                return(Ok(new
                {
                    totalCount = newsletters.Count,
                    data = newsletters
                }));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }