/// <summary> /// Converts a list of ISpeciesObservations to a list with ObservationViewModel which is used /// to present the observations on screen. /// </summary> /// <param name="observations">The observations.</param> /// <returns></returns> public static List <ObservationViewModel> ToObservationViewModelList(this IEnumerable <ISpeciesObservation> observations) { var list = new List <ObservationViewModel>(); if (observations != null) { foreach (ISpeciesObservation obs in observations) { list.Add(ObservationViewModel.Create(obs)); } } return(list); }
/// <summary> /// Converts a ISpeciesObservations to a ObservationViewModel which is used /// to present the observation on screen. /// </summary> /// <param name="observation">The observation.</param> /// <returns></returns> public static ObservationViewModel ToObservationViewModel(this ISpeciesObservation observation) { return(ObservationViewModel.Create(observation)); }