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