コード例 #1
0
ファイル: ChatHub.cs プロジェクト: Softeq/NetKit.Chat
        public async Task <ChannelSummaryResponse> CreateDirectChannelAsync(CreateDirectChannelRequest request)
        {
            return(await ValidateAndExecuteAsync(request, new CreateDirectChannelRequestValidator(), new TaskReference <ChannelSummaryResponse>(async() =>
            {
                var createChannelRequest =
                    new DomainRequest.Channel.CreateDirectChannelRequest(Context.GetSaasUserId(), request.MemberId);

                return await _channelSocketService.CreateDirectChannelAsync(createChannelRequest);
            }),
                                                 request.RequestId));
        }
コード例 #2
0
        public async Task <IActionResult> CreateDirectChannelAsync([FromBody] CreateDirectChannelRequest request)
        {
            var channel = await _channelSocketService.CreateDirectChannelAsync(new CreateDirectChannelRequest(GetCurrentSaasUserId(), request.MemberId));

            return(Ok(channel));
        }