public static DocumentPages GetDocumentById(ObjectId objectId) { DocumentPages doc = new DocumentPages(); using (var db = new LiteDatabase(DataLocation)) { var col = db.GetCollection <DocumentPages>(CollectionName); doc = col.FindById(objectId); } return(doc); }
public static bool InsertUpdateDocument(DocumentPages documentPages) { bool isSuccess = false; using (var db = new LiteDatabase(DataLocation)) { var col = db.GetCollection <DocumentPages>(CollectionName); try { col.Upsert(documentPages); isSuccess = true; } catch (Exception) { } } return(isSuccess); }