public static Restaurant ConvertFromBL(BLRestaurant restaurant) { Restaurant result = new Restaurant { ID = restaurant.ID, Name = restaurant.Name, Address = restaurant.Address, phone = restaurant.Phone, email = restaurant.Email, Reviews = new List <Review>() }; return(result); }
convertRestaurantFromDB(Restaurant dbRestaurant) { BLRestaurant result = new BLRestaurant { ID = dbRestaurant.id, Name = dbRestaurant.name, Address = dbRestaurant.address, Phone = dbRestaurant.phone, Email = dbRestaurant.email, Reviews = new List <BLReview>() }; foreach (Review rev in dbRestaurant.Review) { result.Reviews.Add(ConvertReviewFromDB(rev)); } return(result); }
public static void CreateRestaurant(BLRestaurant restaurant) { CRUD.CreateRestaurant(ConvertFromBL(restaurant)); }
public static void Addrestaurant(BLRestaurant restaurants) { var temp = ConvertFromBL(restaurants); CRUD.CreateRestaurant(temp); }