Exemplo n.º 1
0
 public HomeController(LessionService lessionService, GrammarService grammarService, SoundConservationsService soundConservations, MyWebsiteDbContext dbContext)
 {
     _lessionService     = lessionService;
     _gramarService      = grammarService;
     _soundConservations = soundConservations;
     _dbContext          = dbContext;
 }
Exemplo n.º 2
0
        static FerOmegaInjections()
        {
            InternalGrammarConfig  = new InternalGrammarConfig();
            InternalGrammarService = new GrammarService <IGrammarConfig>(InternalGrammarConfig);

            TokenizationService = new TokenizationService <IGrammarConfig>(InternalGrammarService);

            OperatorService = new OperatorService(InternalGrammarService);

            AstService = new AstService(InternalGrammarService, OperatorService);

            SqlGrammarConfig  = new SqlGrammarConfig();
            SqlGrammarService = new GrammarService <IGrammarConfig>(SqlGrammarConfig);

            SqlProvider = new SqlProvider <IGrammarConfig>(SqlGrammarService);
        }
        public HttpResponseMessage GrammarSuggestions([FromBody] DictionaryDto _DictionaryObj)
        {
            List <Suggestions> _SuggestionsObj = new List <Suggestions>();

            try
            {
                if (string.IsNullOrEmpty(_DictionaryObj.text))
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, Messages.Bad_request_grammar));
                }
                else
                {
                    _SuggestionsObj = GrammarService.GrammarSuggestionsService(_DictionaryObj.text);
                    return(Request.CreateResponse <List <Suggestions> >(HttpStatusCode.OK, _SuggestionsObj));
                }
            }
            catch (Exception Ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, Ex.Message));
            }
        }
        public HttpResponseMessage BulkChangeGrammar([FromBody] DictionaryDto _DictionaryObj)
        {
            Response _ResponseObj = new Response();

            try
            {
                if (string.IsNullOrEmpty(_DictionaryObj.text))
                {
                    return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, Messages.Bad_request_grammar));
                }
                else
                {
                    _ResponseObj = GrammarService.BulkChangeGrammarService(_DictionaryObj.text);
                    return(Request.CreateResponse <Response>(HttpStatusCode.OK, _ResponseObj));
                }
            }
            catch (Exception Ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, Ex.Message));
            }
        }