Exemplo n.º 1
0
        public async Task <ActionResult <EmailModel[]> > Get()
        {
            try
            {
                var results = await _repository.GetAllEmailsAsync();

                return(_mapper.Map <EmailModel[]>(results));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, "Database Failure"));
            }
        }