public List <WordTranslationModel> Post(SearchWordTranslationModel model)
 {
     if (model == null)
     {
         throw new ArgumentNullException("model", "Search model can't be null");
     }
     else
     {
         return(wordTranslationMapper
                .MapRange(wordTranslationService.GetTopBySearchWord(model.SearchWord, model.LanguageId)));
     }
 }
Пример #2
0
        public List <WordTranslationModel> Get(string searchWord, int languageId)
        {
            if (searchWord == null)
            {
                throw new ArgumentNullException("searchWord", "Search word can't be null");
            }
            if (searchWord == String.Empty)
            {
                throw new ArgumentException("Search word can't be empty", "searchWord");
            }
            if (languageId <= 0)
            {
                throw new ArgumentException("Language ID can't be negative or 0", "languageId");
            }

            return(wordTranslationMapper
                   .MapRange(wordTranslationService.GetTopBySearchWord(searchWord, languageId, searchResultsCount)));
        }