/// <summary> /// Create a new GooglePhrase object. /// </summary> /// <param name="id">Initial value of the Id property.</param> /// <param name="word">Initial value of the Word property.</param> /// <param name="englishPhrase">Initial value of the EnglishPhrase property.</param> /// <param name="bengaliPhrase">Initial value of the BengaliPhrase property.</param> public static GooglePhrase CreateGooglePhrase(global::System.Int64 id, global::System.String word, global::System.String englishPhrase, global::System.String bengaliPhrase) { GooglePhrase googlePhrase = new GooglePhrase(); googlePhrase.Id = id; googlePhrase.Word = word; googlePhrase.EnglishPhrase = englishPhrase; googlePhrase.BengaliPhrase = bengaliPhrase; return googlePhrase; }
/// <summary> /// Deprecated Method for adding a new object to the GooglePhrases EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToGooglePhrases(GooglePhrase googlePhrase) { base.AddObject("GooglePhrases", googlePhrase); }
void UpdateGooglePhrase(GreWord word, string en, string bn) { var gs = (_entities.GooglePhrases.Where(w => w.GreWord.Word == word.Word && w.EnglishPhrase == en)).FirstOrDefault(); if (gs == null) { gs = new GooglePhrase() { GreWord = word, EnglishPhrase = en, BengaliPhrase = bn, }; _entities.AddToGooglePhrases(gs); _entities.SaveChanges(); } }