Beispiel #1
0
        public void OnGet()
        {
            this.Message = this.Config["Message"];

            //call the method from the interface to get all restaurants
            Restaurants = restaurantData.GetRestaurantsByName(SearchTerm);
        }
        // GET: /Restaurant/List?QueryString...
        // public void OnGet(string searchRest)
        public void OnGet()
        {
            // One more way to access form data can be using HttpContext
            // To find something in request particularly- Form inputs, QueryString parameter, HTTP header

            // One we used is Model Binding (Note: <input>'s name attribute must match the parameter name
            // TAKE CARE of case when there is no query string then this parameter can raise an exception

            // SearchRest = searchRest;     // First way to bind input property instead of using BindProperty attribute

            Message     = config["Message"];
            Restaurants = restaurantData.GetAll();

            RestaurantsByName = restaurantData.GetRestaurantsByName(SearchRest);
        }