private async Task <IActionResult> ObtainByPairIdAll(string leaderId, string ledId) { var historicalEntityList = await historicalsService.ObtainByPair(leaderId, ledId); var historicalViewModelList = historicalEntityList.Select(HistoricalMap.ToViewModel).ToList(); return(StatusCode((int)StatusCodes.Status200OK, historicalViewModelList)); }
private async Task <IList <HistoricalEntity> > ObtainHistoricalByPair(string leaderId, string ledId) { try { var historical = await historicalsService.ObtainByPair(leaderId, ledId); return(historical); } catch { return(new HistoricalEntity[] { }); } }