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)); }
public HomeController(VocabularyContext vocabularyContext) { _vocabularyContext = vocabularyContext; _efWordDal = new EfWordDal(_vocabularyContext); }