Пример #1
0
 /// <summary>
 /// Create a new GoogleDictionaryHtml object.
 /// </summary>
 /// <param name="word">Initial value of the Word property.</param>
 /// <param name="html">Initial value of the Html property.</param>
 public static GoogleDictionaryHtml CreateGoogleDictionaryHtml(global::System.String word, global::System.String html)
 {
     GoogleDictionaryHtml googleDictionaryHtml = new GoogleDictionaryHtml();
     googleDictionaryHtml.Word = word;
     googleDictionaryHtml.Html = html;
     return googleDictionaryHtml;
 }
Пример #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the GoogleDictionaryHtmls EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToGoogleDictionaryHtmls(GoogleDictionaryHtml googleDictionaryHtml)
 {
     base.AddObject("GoogleDictionaryHtmls", googleDictionaryHtml);
 }
Пример #3
0
        private void AddGoogleHtml(string word, string data)
        {
            var sql = from w in _entities.GoogleDictionaryHtmls
                      where w.Word.Equals(word)
                      select w;

            if (sql.Count() == 0)
            {
                GoogleDictionaryHtml mh = new GoogleDictionaryHtml()
                {
                    Word = word,
                    Html = data
                };
                _entities.AddToGoogleDictionaryHtmls(mh);
                _entities.SaveChanges();
            }
            else
            {
                sql.First().Html = data;
                _entities.SaveChanges();
            }
        }