Пример #1
0
 /// <summary>
 /// Constructs a database Note model from a user Node model.
 /// </summary>
 /// <param name="cryptoDelegate">Crypto delegate to decrypt note.</param>
 /// <param name="key">The security key.</param>
 /// <returns>The database user note model.</returns>
 public Database.Models.Note ToDbModel(ICryptoDelegate cryptoDelegate, string key)
 {
     return(new Database.Models.Note()
     {
         Id = this.Id,
         HdId = this.HdId,
         JournalDateTime = this.JournalDateTime,
         Version = this.Version,
         CreatedDateTime = this.CreatedDateTime,
         CreatedBy = this.CreatedBy,
         UpdatedDateTime = this.UpdatedDateTime,
         UpdatedBy = this.UpdatedBy,
         Title = cryptoDelegate.Encrypt(key, this.Title),
         Text = cryptoDelegate.Encrypt(key, this.Text),
     });
 }
Пример #2
0
 /// <summary>
 /// Constructs a database comment model from a user Node model.
 /// </summary>
 /// <param name="cryptoDelegate">Crypto delegate to decrypt comment.</param>
 /// <param name="key">The security key.</param>
 /// <returns>The database user comment model.</returns>
 public Database.Models.Comment ToDbModel(ICryptoDelegate cryptoDelegate, string key)
 {
     return(new Database.Models.Comment()
     {
         Id = this.Id,
         UserProfileId = this.UserProfileId,
         EntryTypeCode = this.EntryTypeCode,
         ParentEntryId = this.ParentEntryId,
         Version = this.Version,
         CreatedDateTime = this.CreatedDateTime,
         CreatedBy = this.CreatedBy,
         UpdatedDateTime = this.UpdatedDateTime,
         UpdatedBy = this.UpdatedBy,
         Text = cryptoDelegate.Encrypt(key, this.Text),
     });
 }