コード例 #1
0
        public static WordOfDayModel ToModel(this WordOfTheDayResponse @this)
        {
            var model = new WordOfDayModel();

            model.Date   = @this.Date.ToShortDateString();
            model.Phrase = @this.Phrase.ToTransient().ToModel();

            return(model);
        }
コード例 #2
0
        public ActionResult WordOfDay()
        {
            var response = new WordOfDayModel();

            try
            {
                response         = _phraseService.GetWordOfDay();
                response.Success = true;
            }
            catch (SoapException e)
            {
                response.SetError(e);
            }
            catch (Exception e)
            {
                response.SetError(e);
            }

            return(Json(response, JsonRequestBehavior.AllowGet));
        }