예제 #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());
        }
예제 #2
0
 public DocumentMetadata PassValuesTo(DocumentMetadata document)
 {
     document.LastBookmarkUpdate = this.LastUpdate;
     document.Page = this.Page;
     return document;
 }
예제 #3
0
 public Bookmark(DocumentMetadata document)
 {
     this.Id = document.Id;
     this.Page = document.Page;
     this.LastUpdate = document.LastBookmarkUpdate;
 }
예제 #4
0
 public void InsertDocument(DocumentMetadata document)
 {
     this.set.Add(document);
 }
예제 #5
0
 public void DeleteDocument(DocumentMetadata document)
 {
     this.set.Remove(document);
 }
예제 #6
0
 public static void InsertDocument(DocumentMetadata metadata)
 {
     UnitOfWork.Instance.DocumentRepository.InsertDocument(metadata);
 }