/// <summary> /// Create a new SynonymsNetHtml object. /// </summary> /// <param name="word">Initial value of the Word property.</param> /// <param name="html">Initial value of the Html property.</param> public static SynonymsNetHtml CreateSynonymsNetHtml(global::System.String word, global::System.String html) { SynonymsNetHtml synonymsNetHtml = new SynonymsNetHtml(); synonymsNetHtml.Word = word; synonymsNetHtml.Html = html; return synonymsNetHtml; }
/// <summary> /// Deprecated Method for adding a new object to the SynonymsNetHtmls EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSynonymsNetHtmls(SynonymsNetHtml synonymsNetHtml) { base.AddObject("SynonymsNetHtmls", synonymsNetHtml); }
private void AddSynonymsNetHtml(string word, string data) { var e = _entities.EtymologyHtmls; var sql = from w in _entities.SynonymsNetHtmls where w.Word.Equals(word) select w; if (sql.Count() == 0) { SynonymsNetHtml mh = new SynonymsNetHtml() { Word = word, Html = data }; _entities.AddToSynonymsNetHtmls(mh); _entities.SaveChanges(); } else { sql.First().Html = data; _entities.SaveChanges(); } }