public async Task <IList <Exercise> > CallEndpointAsExerciseModel() { IList <Activity> resultList = await this.CallEndpointAsObjectAsync().ConfigureAwait(false); List <Exercise> convertedResultList = new List <Exercise>(); foreach (Activity result in resultList) { convertedResultList.Add(ExerciseApi.ConvertActivityToExercise(result)); } return(convertedResultList); }
public async Task <IList <Exercise> > CallEndpointAsExerciseModel() { try { IList <Activity> resultList = await this.CallEndpointAsObjectAsync().ConfigureAwait(false); List <Exercise> convertedResultList = new List <Exercise>(); foreach (Activity result in resultList) { convertedResultList.Add(ExerciseApi.ConvertActivityToExercise(result)); } return(convertedResultList); } catch (Exception ex) { Tools.Logger.Log(this.GetType().ToString(), ex); } return(new List <Exercise>()); }