private NewsListViewModel ToNewsListViewModel(NewsItem[] newsItems) { var newsViewModel = new NewsListViewModel(); newsViewModel.List = newsItems.Select ( x => ToNewsItemViewModel(x) ) .ToArray(); return newsViewModel; }
private NewsItemViewModel ToNewsItemViewModel(NewsItem newsItem) { return new NewsItemViewModel { Id = newsItem.Id, Headline = newsItem.Headline, DateTime = newsItem.DateTime, Body = newsItem.Body, Type = newsItem.Type, TypeId = newsItem.TypeId }; }