Пример #1
0
        //public Sonnet GetSonnetById(int? id)
        //{
        //    List<Sonnet> sonnets = (_sonnets != null) ? _sonnets : GetSonnets();

        //    foreach (Sonnet sonnet in sonnets)
        //    {
        //        if (id == sonnet.Id)
        //        {
        //            return sonnet;
        //        }
        //    }

        //    // If sonnet was not found
        //    return null;
        //}

        public SonnetHistoryDto GetSonnetHistory(SonnetHistoryParams params_)
        {
            IEnumerable <Misspelling> misspellings =
                _sonnetSqlDao.SelectMisspellingsAll(params_);
            IEnumerable <SonnetStatistic> statistics =
                _sonnetSqlDao.SelectStatisticsAll(params_);

            var sonnetHistory = new SonnetHistoryDto(statistics, misspellings);

            return(sonnetHistory);
        }
Пример #2
0
        public IActionResult GetSonnetHistory(SonnetHistoryParams params_)
        {
            SonnetHistoryDto sonnetHistory = _service.GetSonnetHistory(params_);

            return(Ok(sonnetHistory));
        }