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