public string SpellCheckByPage([FromBody] SpellCheckJsonData spellChecker) { try { SpellChecker spellCheck = new SpellChecker(spellDictionary, personalDictPath); spellCheck.CheckSpelling(spellChecker.LanguageID, spellChecker.TexttoCheck); return(Newtonsoft.Json.JsonConvert.SerializeObject(spellCheck)); } catch { return("{\"SpellCollection\":[],\"HasSpellingError\":false,\"Suggestions\":null}"); } }
public HttpResponseMessage SpellCheckByPage([FromBody] SpellCheckJsonData spellChecker) { try { SpellChecker spellCheck = new SpellChecker(spellDictionary, personalDictPath); spellCheck.CheckSpelling(spellChecker.LanguageID, spellChecker.TexttoCheck); string json = Newtonsoft.Json.JsonConvert.SerializeObject(spellCheck); return(new HttpResponseMessage() { Content = new StringContent(json) }); } catch { return(new HttpResponseMessage() { Content = new StringContent("{\"SpellCollection\":[],\"HasSpellingError\":false,\"Suggestions\":null}") }); } }