Beispiel #1
0
 public static SelectList LoadTypesData()
 {
     using (TypeServiceReference.TypeClient typeService = new TypeServiceReference.TypeClient())
     {
         SelectList selectListItems = new SelectList(typeService.GetTypes(), "Id", "Name");
         return(selectListItems);
     }
 }
Beispiel #2
0
        // GET: Type
        public ActionResult Index()
        {
            List <TypeViewModel> typeVM = new List <TypeViewModel>();

            using (TypeServiceReference.TypeClient service = new TypeServiceReference.TypeClient())
            {
                foreach (var item in service.GetTypes())
                {
                    typeVM.Add(new TypeViewModel(item));
                }
            }
            return(View(typeVM));
        }