private static List <WordAnnotation> GetAnnotations(this LiteRepository repo, string contentMd5) { var pdf = repo.GetPdf(contentMd5); if (pdf == null) { return(null); } return(repo.Fetch <WordAnnotation>(wa => wa.Document.Id == pdf.Id)); }
private static void EnsurePdfFile(this LiteRepository repo, PdfFile value, bool updateLastSeen = true) { var pdf = repo.GetPdf(value.Md5); if (pdf == null) { value.Id = (Guid)repo.Insert <PdfFile>(value); } else { value.Id = pdf.Id; } if (updateLastSeen) { value.LastSeen = DateTime.Now; } repo.Update(value); }