コード例 #1
0
 public string GetReferecne(string referenceId, string type)
 {
     using (LiteDatabase db = new LiteDatabase(_persistancePath))
     {
         LiteCollection <ReferenceDBModel> collection = db.GetCollection <ReferenceDBModel>(COLLECTION_REFERENCE);
         ReferenceDBModel model = collection.FindOne(x => x.ReferenceId
                                                     == referenceId && x.Type == type);
         return(model.Value);
     }
 }
コード例 #2
0
 public void SaveReference(string referenceId, string type, string value)
 {
     using (LiteDatabase db = new LiteDatabase(_persistancePath))
     {
         LiteCollection <ReferenceDBModel> collection = db.GetCollection <ReferenceDBModel>(COLLECTION_REFERENCE);
         ReferenceDBModel model = new ReferenceDBModel();
         model.ReferenceId = referenceId;
         model.Type        = type;
         model.Value       = value;
         collection.Insert(model);
     }
 }