Пример #1
0
        public async Task <ActionResult> GetInput(DataModelEntity dataModelEntity)
        {
            if (ModelState.IsValid)
            {
                var caller = new ApiCaller();
                var cos    = await caller.CallToApi(dataModelEntity.InputString);

                dataModelEntity.TranslatedString = cos.ToString();
                db.dataModelEntities.Add(dataModelEntity);
                db.SaveChanges();

                return(View("TranslatedString", dataModelEntity));
            }

            return(Content("Please, enter the text!"));
        }