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