Exemple #1
0
        public async Task <IEnumerable <Reader> > Get(string userName = "")
        {
            if (!string.IsNullOrEmpty(userName))
            {
                var readers = await _repository.Find(new InputModel { Username = userName });

                return(readers);
            }
            else
            {
                var readers = await _repository.All();

                return(readers.Readers);
            }
        }
Exemple #2
0
        // GET: ReadersController
        public async Task <ActionResult> Index(string userName = "")
        {
            if (!string.IsNullOrEmpty(userName))
            {
                var readers = await _repository.Find(new SearchRequest { UserName = userName });

                return(View(new ReaderViewModel
                {
                    Readers = readers,
                    ResultsType = ResultsType.Search
                }));
            }
            else
            {
                var readers = await _repository.All();

                return(View(readers));
            }
        }