public static restaurant ToDataLayer(Restaurant restaurantLib)
        {
            restaurant restaurantData = new restaurant();
            restaurantData.id = restaurantLib.id;
            restaurantData.name = restaurantLib.name;
            restaurantData.address = restaurantLib.address;
            restaurantData.phoneNumber = restaurantLib.phoneNum;

            foreach (var curReviewLib in restaurantLib.reviews)
            {
                restaurantData.reviews.Add(ReviewMapper.ToDataLayer(curReviewLib, restaurantData));
            }

            return restaurantData;
        }
示例#2
0
 public void UpdateReview(Review editFrom)
 {
     dbCrud.Update(ReviewMapper.ToDataLayer(editFrom, RestaurantMapper.ToDataLayer(editFrom.restaurant)));
 }
示例#3
0
 public void CreateReview(Review toCreate)
 {
     dbCrud.Create(ReviewMapper.ToDataLayer(toCreate, RestaurantMapper.ToDataLayer(toCreate.restaurant)));
 }