示例#1
0
        public ActionResult GetAllTypes()
        {
            var types = _typeRepository.GetTypes()
                        .Select(t => new TypesViewModel
            {
                TypeID   = t.TypeID,
                TypeName = t.TypeName
            }).ToList();

            return(View("GetAllTypes", types));
        }
示例#2
0
        public ActionResult Create()
        {
            var model = new WineViewModel();

            model.TypesList      = _typesRepository.GetTypes();
            model.SubTypesList   = _subTypeRepository.GetAll();
            model.BottleSizeList = _bottleSizeRepository.GetAll();
            model.RegionList     = _regionRepository.GetAll();
            model.CountryList    = db.Countries.ToList();

            return(View(model));
        }
示例#3
0
 public IEnumerable <Types> GetTypes()
 {
     return(_repository.GetTypes());
 }