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); } }
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); } }