Esempio n. 1
0
        public IActionResult Index(string key)
        {
            if (key == null)
            {
                key = "";
            }
            string sortType  = Request.Query["sortType"];
            var    efWordDal = new EfWordDal(_vocabularyContext);
            var    words     = efWordDal.GetByWord(key);
            var    model     = new HomeIndexViewModel()
            {
                Words = SortWords(words, sortType)
            };

            return(View(model));
        }
Esempio n. 2
0
 public HomeController(VocabularyContext vocabularyContext)
 {
     _vocabularyContext = vocabularyContext;
     _efWordDal         = new EfWordDal(_vocabularyContext);
 }