コード例 #1
0
        public ActionResult Create()
        {
            var userGroupList = new SelectList(userGroupRepository.GetUserGroupsWithCurrencyInfo()
                                               .Select(
                                                   m => new SelectListItem()
            {
                Value = m.Id.ToString(),
                Text  = (m.Name + " - " + m.CurrencyCode)
            }
                                                   ), "Value", "Text").ToList();

            ViewBag.UserGroupList = userGroupList;

            CollegeGroupVM model = new CollegeGroupVM();

            model.UserGroupId = userGroupRepository.GetUserGroupByName().FirstOrDefault().ID;

            return(View(model));
        }