예제 #1
0
 internal void FillPinyin()
 {
     using (var context = base.CreateContext())
     {
         var q = from t in context.SearchKeywords
                 where t.Pinyin == null
                 select t;
         foreach (var item in q)
         {
             item.Pinyin     = PinyinHelper.ConvertToPinyin(item.Keyword);
             item.PinyinCaps = PinyinHelper.ConvertToPinyinCaps(item.Keyword);
         }
         context.SaveChanges();
     }
 }