Beispiel #1
0
 public ReviewViewModels MapReviewModelToReviewViewModels(Review review)
 {
     reviewViewModels = new ReviewViewModels();
     if (review != null)
     {
         reviewViewModels.Id           = review.Id;
         reviewViewModels.CategoryName = review.Category.Name;
         reviewViewModels.Name         = review.Name;
         reviewViewModels.Description  = review.Description;
     }
     return(reviewViewModels);
 }
Beispiel #2
0
        public List <ReviewViewModels> ReviewModelToReviewGridViewModels(IEnumerable <Review> review)
        {
            List <ReviewViewModels> reviewViewModelsList = new List <ReviewViewModels>();

            if (review.Count() != 0)
            {
                foreach (Review item in review)
                {
                    ReviewViewModels reviewViewModels = new ReviewViewModels
                    {
                        Id           = item.Id,
                        Name         = item.Name,
                        Description  = item.Description,
                        CategoryName = item.Category.Name
                    };
                    reviewViewModelsList.Add(reviewViewModels);
                }
            }
            return(reviewViewModelsList);
        }