Example #1
0
        public async Task<IHttpActionResult> PostDocument(DocumentMetadata metadata)
        {
            IdentityUser user = await DbFacade.FindUserByName(this.User.Identity.Name);
            metadata.UserId = user.Id;
            metadata.Page = 0;
            metadata.LastBookmarkUpdate = DateTime.UtcNow;

            DbFacade.InsertDocument(metadata);
            DbFacade.Save();

            return this.Ok(metadata.Id.ToString());
        }
Example #2
0
 public DocumentMetadata PassValuesTo(DocumentMetadata document)
 {
     document.LastBookmarkUpdate = this.LastUpdate;
     document.Page = this.Page;
     return document;
 }
Example #3
0
 public Bookmark(DocumentMetadata document)
 {
     this.Id = document.Id;
     this.Page = document.Page;
     this.LastUpdate = document.LastBookmarkUpdate;
 }
Example #4
0
 public void InsertDocument(DocumentMetadata document)
 {
     this.set.Add(document);
 }
Example #5
0
 public void DeleteDocument(DocumentMetadata document)
 {
     this.set.Remove(document);
 }
Example #6
0
 public static void InsertDocument(DocumentMetadata metadata)
 {
     UnitOfWork.Instance.DocumentRepository.InsertDocument(metadata);
 }