コード例 #1
0
 public void saveEntry(QueryDictResult inDictData)
 {
     try
     {
         using (var streamdb = Eviroment.getR_W_fromResource(localBaseFileName))
             using (var db = new LiteDatabase(streamdb))
             {
                 var dictionary = db.GetCollection <DictEntry>("Dictionary");
                 if (!inDictData.IsEmpty && !dictionary.Exists(x => x.EntryData.sourceText == inDictData.sourceText))
                 {
                     var dictSqlReg = new DictEntry();
                     dictSqlReg.EntryData = inDictData;
                     dictionary.EnsureIndex(x => x.EntryData.sourceText);
                     dictionary.Insert(dictSqlReg);
                 }
             }
     }
     catch (Exception ex)
     {
         log.Debug(ex.StackTrace);
     }
 }