コード例 #1
0
        /************************************ Home Page *******************************************************/

        public async Task <ActionResult> Index()
        {
            var Services = await siteService.GetAllServices();

            if (Services == null)
            {
                return(HttpNotFound());
            }

            List <string> ServiceNamesList = new List <string>();

            foreach (var service in Services)
            {
                ServiceNamesList.Add(service.ServiceName);
            }
            string[] ServiceNamesArray = ServiceNamesList.ToArray();

            ViewBag.ServiceNames = ServiceNamesArray;
            return(View(Services));
        }