Пример #1
0
        public ActionResult Hello()
        {
            var uri = new GetExample().ToAbsoluteUri();

            ViewBag.Message = uri;
            return(View());
        }
        // GET api/values
        public IEnumerable <string> Get()
        {
            var command = new GetExample();

            // Optionally set params

            return(command.Commander.Handle(command));
        }
Пример #3
0
 public object Any(GetExample request)
 {
     return new GetExampleResponse
     {
         MenuExample1 = new MenuExample
         {
             MenuItemExample1 = new MenuItemExample { Name1 = "foo" }
         }
     };
 }
Пример #4
0
 public object Any(GetExample request)
 {
     return(new GetExampleResponse
     {
         MenuExample1 = new MenuExample
         {
             MenuItemExample1 = new MenuItemExample {
                 Name1 = "foo"
             }
         }
     });
 }
        // GET api/values/5
        public string Get(int id)
        {
            var command = new GetExample();
            // Optionally set params

            string response;

            try
            {
                response = command.Commander.Handle(command)[id - 1];
            }
            catch (Exception ex)
            {
                response = ex.Message;
            }

            return(response);
        }