public async Task <ActionResult> Post(ConfirmRequest doubleCheck) { try { if (!doubleCheck.Confirm) { _responseContext.SetResponseContext(new StatusResponse("Unauthorized", "Operation not confirmed")); return(_responseContext.GetResponse()); } await _tradeRiskService.RemoveAll(); _responseContext.SetResponseContext(new StatusResponse("Success", "Portfolio successfully deleted")); return(_responseContext.GetResponse()); } catch (Exception ex) { _responseContext.SetResponseContext(new ErrorResponse <ResetTradesController>(_logger, ex)); return(_responseContext.GetResponse()); } }
public async Task <ActionResult <List <Trade> > > Get() { try { List <Trade> trades = await _tradeRiskService.Get(); _responseContext.SetResponseContext(new TradeListResponse(trades)); return(_responseContext.GetResponse()); } catch (Exception ex) { _responseContext.SetResponseContext(new ErrorResponse <TradesController>(_logger, ex)); return(_responseContext.GetResponse()); } }