Exemple #1
0
        public static ReviewApiModel getReviewApiModel(this ReviewModel reviewModel, String userName)
        {
            ReviewApiModel reviewApiModel = new ReviewApiModel
            {
                Rating   = (int)reviewModel.Rating,
                Opinion  = reviewModel.Opinion,
                LastEdit = String.Format("{0:yyyy-MM-dd HH:mm}", reviewModel.LastEdit),
                UserName = userName
            };

            return(reviewApiModel);
        }
Exemple #2
0
        public static ReviewModel getReviewModel(this ReviewApiModel reviewApiModel, String Id, String UserId, String EventId)
        {
            ReviewModel reviewModel = new ReviewModel
            {
                Id       = new ObjectId(Id),
                Rating   = reviewApiModel.Rating,
                Opinion  = reviewApiModel.Opinion,
                LastEdit = DateTime.ParseExact(reviewApiModel.LastEdit, "yyyy-MM-dd HH:mm", CultureInfo.InvariantCulture),
                UserId   = new ObjectId(UserId),
                EventId  = new ObjectId(EventId)
            };

            return(reviewModel);
        }