public JsonResult Get(int id, string l) { var quote = _repository.GetById(id); if (l == null || l.Length == 0) { return(Json(Mapper.Map <IEnumerable <ZenMessageViewModel> >(new List <ZenQuote>() { quote }))); } return(Json(ZenMessageConverter.Convert(quote, l))); }
public IActionResult Image(int id, string l) { var quote = _repository.GetById(id); if (l == null || l.Length == 0) { l = "EN"; } var viewModel = ZenMessageConverter.Convert(quote, l); var quoteImage = new ZenQuoteImage(viewModel, _hostingEnvironment); return(File(quoteImage.GetImage(), "image/png")); }