internal Result <List <SecurityPrice> > GetSecurityPrices(DateTime date) { Maybe <TradeDate> tradeDate = _tradeDateRepository.GetTradeDate(date); if (tradeDate.HasValue) { return(GetSecurityPrices(tradeDate.Value)); } else { return(Result.Failure <List <SecurityPrice> >(new InvalidTradeDateError(date))); } }
public Result <TradeDate> GetTradeDate(DateTime date) { var tradeDate = _tradeDateRepository.GetTradeDate(date.Date); return(tradeDate.Eval <Result <TradeDate> >( (d) => Result.Success <TradeDate>(d), () => Result.Failure <TradeDate>(new InvalidTradeDateError(date)))); }