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; }
public void UpdateReview(Review editFrom) { dbCrud.Update(ReviewMapper.ToDataLayer(editFrom, RestaurantMapper.ToDataLayer(editFrom.restaurant))); }
public void CreateReview(Review toCreate) { dbCrud.Create(ReviewMapper.ToDataLayer(toCreate, RestaurantMapper.ToDataLayer(toCreate.restaurant))); }