コード例 #1
0
 public static void ExecuteRequests()
 {
     try
     {
         APIQueries.MakeRequest();
         string json = APIQueries.GetResponse();
         Word   word = UserInterface.ConvertJsonToObject(json);
         WordsBusiness.Add(word);
     }
     catch (Exception)
     {
         throw;
     }
 }
コード例 #2
0
        public static string GetWord(string wordId, string lang)
        {
            Word word = WordGetter.GetWordFromDb(wordId);

            if (word != default(Word))
            {
                //send to the controller to be displayed
                return(Displayer <object>(word.Results));
            }
            else
            {
                string json = APIQueries.GetEntries(lang, wordId);
                word = ConvertJsonToObject(json);
                WordsBusiness.Add(word);
                // send to the controller to be displayed
                return(Displayer <IJoinCLasses>(word.Results));
            }
        }
コード例 #3
0
 public static Word GetWordFromDb(string wordId)
 {
     return(WordsBusiness.Get(wordId));
 }