public async Task <IActionResult> GetIdeasForAuthor(Guid userId) { var request = new GetIdeasForAuthorRequest(userId); var response = await _requestBus.RequestAsync <GetIdeasForAuthorRequest, IdeasDTO>(request); return(Ok(response)); }
public static async Task <UiOperationResult> RequestReceiveLog(ContextModel model, IRequestBus _socket, Action <object> _log) { System.Console.WriteLine("send model - Type: [" + typeof(ContextModel).Name + "]"); UiOperationResult uiResult = await _socket.RequestAsync(model); _log($"uiResult: [{uiResult.IsSuccess}] - ResultName: [{uiResult.ResultName}] - Amount: [{uiResult.ConfigurationModels?.Count}]\nError:[{uiResult.ErrorMessage}]"); System.Console.WriteLine("-".PadRight(50, '-')); return(uiResult); }
public async void SendRequest <TRequest, TResponse>(TRequest request) where TRequest : IRequest <TResponse> where TResponse : IResponse { try { Response = await _requestBus.RequestAsync <TRequest, TResponse>(request); } catch (Exception e) { Exception = e; } }
public async Task <IActionResult> Get() { var response = await _requestBus.RequestAsync <UsersRequest, UsersDTO>(new UsersRequest()); return(Ok(response)); }