public static StockQuotationProposal CreateQuotationProposal(CreateStockQuotationRequest request) { var brokerName = BrokersConfiguration.Ids .Where(x => x.Value == request.OwnerId) .FirstOrDefault() .Key; return(new StockQuotationProposal(request.StockShares, request.StockIdentifier, brokerName, request.Price, request.OwnerId, request.type)); }
public async Task <ActionResult <StockQuotationProposal> > PublishStockQuotation( [FromBody] CreateStockQuotationRequest request) { Console.WriteLine("-------------------------------------------"); var notifiedQuotation = CreateQuotationPipeline .CreateQuotationProposal(request) .LogQuotationProposal() .PublishProposal(_newYorkStockExchange); Console.WriteLine("\n-------------------------------------------"); return(Ok(notifiedQuotation)); }