示例#1
0
        public ActionResult Index()
        {
            var hosts = _hostService.GetHosts();

            return(View(new IndexViewData {
                Hosts = hosts.Select(h => new HostDto {
                    Id = h.Id, Name = h.Name
                })
            }));
        }
示例#2
0
 public IHttpActionResult GetHosts()
 {
     return(Ok(hostService.GetHosts()));
 }