public TranslationDomainModel TranslateMessage(TranslationDomainModel translation)
        {
            // read message from file

            translation.SetTranslatedMessage(translation.OriginalMessage + " - file datasource");
            return(translation);
        }
        public TranslationDomainModel TranslateMessage(TranslationDomainModel translation)
        {
            // create http client
            // call the endpoint to get the translated message

            translation.SetTranslatedMessage(translation.OriginalMessage + " - api datasource");
            return(translation);
        }
Esempio n. 3
0
        public TranslateLogicResponse TranslanteMyMessagePlease(string msg)
        {
            TranslationDomainModel model = new TranslationDomainModel(msg);

            var result = _dataSource.TranslateMessage(model);
            TranslateLogicResponse response = new TranslateLogicResponse {
                Message = $"Original message: '{result.OriginalMessage}' - Translated message: '{result.TranslatedMessage}'"
            };

            return(response);
        }
        public TranslationDomainModel TranslateMessage(TranslationDomainModel translation)
        {
            // get translated text from SQL database
            //using (var context = new MyDbContext())
            //{
            //      Perform data access using the context
            //}

            translation.SetTranslatedMessage(translation.OriginalMessage + " - SQL datasource");
            return(translation);
        }