public RestaurantInfo(RestaurantsRestaurant restaurant) { Rating = restaurant.Rating; Name = restaurant.Name; Summary = restaurant.Summary; Location = new Address() { Street = restaurant.RestaurantAddress.Address, City = restaurant.RestaurantAddress.City, PostalCode = restaurant.RestaurantAddress.PostalCode, Province = Enum.GetName(typeof(ProvinceType), restaurant.RestaurantAddress.Province) }; }
public RestaurantInfo GetRestaurantInfo(RestaurantsRestaurant rest) { RestaurantInfo newRestaurant = new RestaurantInfo(); Address newAddress = new Address(); newAddress.city = rest.Address.city; newAddress.address = rest.Address.address; newAddress.postalcode = rest.Address.postalcode; newAddress.province = rest.Address.province; newRestaurant.Name = rest.Name; newRestaurant.Food = rest.Food; newRestaurant.Summary = rest.Summary; newRestaurant.Rating = rest.Rating.Value; newRestaurant.Price = rest.Price.Value; newRestaurant.address = newAddress; return(newRestaurant); }