public MonthlyReturnDto[] GetMonthlyReturnSeries(int entityNumber) { var returnSeries = _returnsSeriesDataGateway.GetReturnSeries(new[] { entityNumber }).First(); var monthlyReturns = _monthlyReturnsDataGateway.GetMonthlyReturns(returnSeries.ReturnSeriesId); return(monthlyReturns); }
private MonthlyReturnDto[] GetMonthlyReturns( ReturnSeriesDto[] returnSeries) { var distinctReturnSeriesIds = returnSeries .Select(d => d.ReturnSeriesId) .Distinct() .ToArray(); var monthlyReturnDtos = _monthlyReturnsDataGateway .GetMonthlyReturns(distinctReturnSeriesIds); return(monthlyReturnDtos); }
public void ShouldReadAndWriteMonthlyReturns() { var newReturnsSeries = InsertTestReturnSeries(); var testMonthlyReturns = CreateTestMonthlyReturns(newReturnsSeries); _monthlyReturnsDataGateway.InsertMonthlyReturns(testMonthlyReturns); var savedMonthlyReturns = _monthlyReturnsDataGateway.GetMonthlyReturns(newReturnsSeries.ReturnSeriesId); AssertMonthlyReturnsAreValid(savedMonthlyReturns, newReturnsSeries.ReturnSeriesId); _monthlyReturnsDataGateway.DeleteMonthlyReturns(newReturnsSeries.ReturnSeriesId); _returnsSeriesDataGateway.DeleteReturnSeries(newReturnsSeries.ReturnSeriesId); }