public int AddRestaurant(CreateRestaurantModel restaurant)
        {
            //assumption: calls would usually be in using() statement

            //just return fake id
            return(99);
        }
Esempio n. 2
0
        public SaveResponse AddRestaurant(CreateRestaurantModel restaurant)
        {
            //assumption: we would expect user information as well, and would record who was creating the object
            var response = new SaveResponse();

            try
            {
                response.Id = _dataAccess.AddRestaurant(restaurant);
            }
            catch
            {
                // assumption: exceptions would be logged, and handled gracefully vs thrown
                response.ErrorMessage = "Unable to add Restaurant";
            }
            return(response);
        }