Exemplo n.º 1
0
        protected string GetArchivedNoteUrl(string guid, long revision)
        {
            var url = new GetArchivedNoteRequest()
            {
                Guid     = guid,
                Username = RainyTestServer.TEST_USER,
                Revision = revision
            }.ToUrl("GET");

            return(testServer.ListenUrl + url);
        }
Exemplo n.º 2
0
        public object Get(GetArchivedNoteRequest request)
        {
            using (var db = connFactory.OpenDbConnection ()) {
                var archived_note = db.FirstOrDefault<DBArchivedNote> (an => an.Username == requestingUser.Username && an.Guid == request.Guid);

                if (archived_note == null)
                    throw new Rainy.ErrorHandling.InvalidRequestDtoException ();

                DBUser db_user = null;
                if (archived_note.IsEncypted) {
                    if (db_user == null)
                        db_user = db.First<DBUser> (u => u.Username == requestingUser.Username);

                    archived_note.Decrypt (db_user, requestingUser.EncryptionMasterKey);
                }

                return archived_note.ToDTONote ();
            }
        }
Exemplo n.º 3
0
 protected string GetArchivedNoteUrl(string guid, long revision)
 {
     var url = new GetArchivedNoteRequest () {
         Guid = guid,
         Username = RainyTestServer.TEST_USER,
         Revision = revision
     }.ToUrl ("GET");
     return testServer.ListenUrl + url;
 }