public static RestaurantDL.Restaurant ToData(Restaurant webRestaurant)
        {
            var dataRestaurant = new RestaurantDL.Restaurant()
            {
                id      = webRestaurant.id,
                name    = webRestaurant.name,
                address = webRestaurant.address,
                email   = webRestaurant.email,
                phone   = webRestaurant.phone
            };

            return(dataRestaurant);
        }
Beispiel #2
0
        public static Restaurant ToWeb(RestaurantDL.Restaurant dataRestaurant)
        {
            var webRestaurant = new Restaurant()
            {
                id      = dataRestaurant.id,
                name    = dataRestaurant.name,
                address = dataRestaurant.address,
                email   = dataRestaurant.email,
                phone   = dataRestaurant.phone
            };

            return(webRestaurant);
        }
        public static Restaurant ToWeb(RestaurantDL.Restaurant dataRestaurant)
        {
            var webRestaurant = new Restaurant()
            {
                id      = dataRestaurant.id,
                name    = dataRestaurant.name,
                address = dataRestaurant.address,
                email   = dataRestaurant.email,
                phone   = dataRestaurant.phone
                          //This causes a stack overflow exception!!!
                          //Reviews = ToWeb(dataRestaurant.Reviews)
            };

            return(webRestaurant);
        }