This commit is contained in:
@@ -92,24 +92,25 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
//Save the context in order to get the id's of the new words added
|
//Save the context in order to get the id's of the new words added
|
||||||
ct.SaveChanges();
|
ct.SaveChanges();
|
||||||
====HERE
|
|
||||||
//Now add the id's of the newly created words to the matching keyword id list for this object
|
|
||||||
//OLD BORING WAY:
|
|
||||||
// foreach (SearchDictionary SD in ct.SearchDictionary.Local)
|
|
||||||
// {
|
|
||||||
// MatchingKeywordIdList.Add(SD.Id);
|
|
||||||
// }
|
|
||||||
|
|
||||||
//Linq all the things! (I'm so clever)
|
//Now add the id's of the newly created words to the matching keyword id list for this object
|
||||||
MatchingKeywordIdList.AddRange(ct.SearchDictionary.Local.Select(m => m.Id).ToList());
|
foreach (SearchDictionary SD in ct.SearchDictionary.Local)
|
||||||
|
{
|
||||||
|
bool IsName = false;
|
||||||
|
if (NameKeyWordList.Contains(SD.Word))
|
||||||
|
IsName = true;
|
||||||
|
MatchingKeywordIdList.Add(new MatchingDictionaryEntry() { DictionaryId = SD.Id, InName = IsName });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//CREATE THE SEARCHKEY RECORDS FOR ALL THE KEYWORDS
|
//CREATE THE SEARCHKEY RECORDS FOR ALL THE KEYWORDS
|
||||||
foreach (long KeyWordId in MatchingKeywordIdList)
|
foreach (MatchingDictionaryEntry E in MatchingKeywordIdList)
|
||||||
{
|
{
|
||||||
if ()
|
ct.SearchKey.Add(new SearchKey() { WordId = E.DictionaryId, InName = E.InName });
|
||||||
ct.SearchDictionary.Add(new SearchKey() { Word = KeyWord });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ct.SaveChanges();
|
||||||
|
|
||||||
}//eoc
|
}//eoc
|
||||||
|
|
||||||
//Class to hold temporary list of matching id
|
//Class to hold temporary list of matching id
|
||||||
|
|||||||
Reference in New Issue
Block a user