Ejemplo n.º 1
0
        public IActionResult Deconvert(string id, [Bind("Id,InputText,OutputText")] ManoText manoText)
        {
            var inputText  = string.Empty;
            var outputText = string.Empty;

            if (id != manoText.Id)
            {
                return(NotFound());
            }
            if (ModelState.IsValid)
            {
                inputText = manoText.InputText;
                var translator = new Translator();
                outputText = translator.Decode(manoText.InputText ?? string.Empty);
            }

            return(RedirectToAction(nameof(Index), new ManoText {
                Id = Guid.NewGuid().ToString(), InputText = inputText, OutputText = outputText
            }));
        }
Ejemplo n.º 2
0
 public IActionResult Index(ManoText manoText)
 {
     return(View(manoText));
 }