public async Task HandleAsync(NotificationSeenCommand command) { command.NotificationIds.ForEach(x => { _context.NotificationUserSeen .FirstOrDefault(t => t.UserId == command.UserId && t.NotificationId == x) .Seen = true; }); await _context.SaveChangesAsync(); }
public async Task <IActionResult> Seen(NotificationSeenCommand command) { await _commandBus.ExecuteAsync(command); return(Ok()); }