// CREATE
 public async Task AddReviewAsync(DL.Review item)
 {
     using (var db = new LocalGourmetDBEntities())
     {
         db.Reviews.Add(item);
         await db.SaveChangesAsync();
     }
 }
Example #2
0
        public static DL.Review LibraryToData(BLL.Models.Review libModel)
        {
            var dataModel = new DL.Review();

            {
                dataModel.ID               = libModel.ID;
                dataModel.RestaurantID     = libModel.RestaurantID;
                dataModel.ReviewerName     = libModel.ReviewerName;
                dataModel.Comment          = libModel.Comment;
                dataModel.FoodRating       = libModel.FoodRating;
                dataModel.ServiceRating    = libModel.ServiceRating;
                dataModel.AtmosphereRating = libModel.AtmosphereRating;
                dataModel.PriceRating      = libModel.PriceRating;
            };
            return(dataModel);
        }
Example #3
0
        public static BLL.Models.Review DataToLibrary(DL.Review dataModel)
        {
            int revID = dataModel.ID;

            var libModel = new BLL.Models.Review()
            {
                ID               = dataModel.ID,
                RestaurantID     = dataModel.RestaurantID,
                ReviewerName     = dataModel.ReviewerName,
                Comment          = dataModel.Comment,
                FoodRating       = dataModel.FoodRating,
                ServiceRating    = dataModel.ServiceRating,
                AtmosphereRating = dataModel.AtmosphereRating,
                PriceRating      = dataModel.PriceRating
            };

            return(libModel);
        }
Example #4
0
 // CREATE
 public async Task AddReviewAsync()
 {
     DL.Review      review = LibraryToData(this);
     ReviewAccessor ra     = new ReviewAccessor();
     await ra.AddReviewAsync(review);
 }