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); }
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); }