Exemplo n.º 1
0
        public override async Task <AddEmailMessageResponse> AddEmailMessage(AddEmailMessageRequest request, ServerCallContext context)
        {
            /// var user = context.GetHttpContext().User;

            var message = new Entities.EmailMessage
            {
                From    = request.Message.From,
                Tos     = request.Message.Tos,
                CCs     = request.Message.CCs,
                BCCs    = request.Message.BCCs,
                Subject = request.Message.Subject,
                Body    = request.Message.Body,
            };

            await _dispatcher.DispatchAsync(new AddOrUpdateEntityCommand <Entities.EmailMessage>(message));

            var response = new AddEmailMessageResponse
            {
                Message = request.Message
            };

            response.Message.Id = message.Id.ToString();

            return(response);
        }
Exemplo n.º 2
0
        public override Task <AddEmailMessageResponse> AddEmailMessage(AddEmailMessageRequest request, ServerCallContext context)
        {
            var message = new Entities.EmailMessage
            {
                From    = request.Message.From,
                Tos     = request.Message.Tos,
                CCs     = request.Message.CCs,
                BCCs    = request.Message.BCCs,
                Subject = request.Message.Subject,
                Body    = request.Message.Body,
            };

            _dispatcher.Dispatch(new AddOrUpdateEntityCommand <Entities.EmailMessage>(message));

            var response = new AddEmailMessageResponse
            {
                Message = request.Message
            };

            response.Message.Id = message.Id.ToString();

            return(Task.FromResult(response));
        }