コード例 #1
0
 public void Add(AccountNoteEntry accountNoteEntry)
 {
     using (var context = _contextFactory.Invoke())
     {
         context.Save(accountNoteEntry);
     }
 }
コード例 #2
0
 public NoteModel(AccountNoteEntry accountNoteEntry)
 {
     // Initialize properties of base class dynamically
     foreach (var prop in typeof(AccountNoteEntry).GetProperties())
     {
         GetType().GetProperty(prop.Name).SetValue(this, prop.GetValue(accountNoteEntry, null), null);
     }
 }
コード例 #3
0
        private void AddNote(AccountManagementModel accountManagementModel, NoteType noteType, string noteContent)
        {
            var accountNoteEntry = new AccountNoteEntry
            {
                AccountId          = accountManagementModel.Id,
                WriterAccountId    = new Guid(AuthSession.UserAuthId),
                WriterAccountEmail = AuthSession.UserAuthName,
                Type         = noteType,
                CreationDate = DateTime.Now,
                Note         = noteContent
            };

            _accountNoteService.Add(accountNoteEntry);
            if (accountManagementModel.Notes == null)
            {
                accountManagementModel.Notes = new List <NoteModel>();
            }
            accountManagementModel.Notes.Insert(0, new NoteModel(accountNoteEntry));
        }