コード例 #1
0
        public async Task <IActionResult> Create(CreateMailRequest request)
        {
            var id = await _dispatcher.Command <CreateMailCommand, int>(new CreateMailCommand
            {
                Sender     = request.Sender,
                Recipients = request.Recipients,
                Subject    = request.Subject,
                Body       = request.Body,
                Priority   = request.Priority
            }); // TODO use some mappers

            return(Created(new Uri($"/mails/{id}", UriKind.Relative), new { id }));
        }