public async Task ProcessAsync(byte[] messageData)
        {
            var stringMessage = Encoding.UTF8.GetString(messageData);

            var message = JsonConvert.DeserializeObject <SendEmailModel>(stringMessage);

            await _emailService.SendMailAsync(message);
        }
示例#2
0
        public async Task <IActionResult> Post(SendEmailModel model)
        {
            try
            {
                await _sendEmailService.SendMailAsync(model);
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message + " | " + e.InnerException?.Message));
            }

            return(NoContent());
        }