public async Task EditJournalEntryReplyAsync(Guid entryId, JournalReply reply) { var replyEntry = _db.JournalReplies.FirstOrDefault(x => x.Id == entryId); if (replyEntry != null) { SetCreatedUpdated(reply); replyEntry.Body = reply.Body; await SaveChangesAsync(); } }
public async Task AddJournalEntryReplyAsync(Guid entryId, JournalReply reply) { var entry = await _db.JournalEntries.FirstOrDefaultAsync(x => x.Id == entryId); if (entry != null) { SetCreatedUpdated(reply); reply.JournalEntryId = entryId; entry.Replies.Add(reply); await SaveChangesAsync(); } }