public void SetUp() { _service = new Mock <IGetNotificationsService>(); _sut = new GetNotificationsQueryHandler(_service.Object); _query = new GetNotificationsQuery(); }
public NotificationsController(GetNewNotificationsQuery getNewNotificationsQuery, CheckForNewNotificationsQuery checkForNewNotificationsQuery, CreateNotificationCommand createNotificationCommand, MarkNotificationAsSeenCommand markNotificationAsSeenCommand, GetNotificationsQuery getNotificationsQuery, TaskExecutor.TaskExecutor taskExecutor) { this.getNotificationsQuery = getNotificationsQuery; this.getNewNotificationsQuery = getNewNotificationsQuery; this.createNotificationCommand = createNotificationCommand; this.markNotificationAsSeenCommand = markNotificationAsSeenCommand; this.checkForNewNotificationsQuery = checkForNewNotificationsQuery; this.taskExecutor = taskExecutor; }
public async Task<IActionResult> Get(string include) { if(include == "logs") { var result = new GetNotificationsWLogsQuery(); return Ok(await _mediatr.Send(result)); } else { var result = new GetNotificationsQuery(); return Ok(await _mediatr.Send(result)); } }
public async Task <ActionResult> Get(string include) { if (include == "logs") { var notif = new GetAllQuery(); return(Ok(await _mediatr.Send(notif))); } else { var notif = new GetNotificationsQuery(); return(Ok(await _mediatr.Send(notif))); } }
public async Task <Result <List <Notification> > > Handle(GetNotificationsQuery request, CancellationToken cancellationToken) { var list = await _dbContext.Notifications.ToListAsync(); return(Result.Ok(list)); }
public async Task<ActionResult<PagenatedList<NotificationViewModel>>> Get( [FromQuery] GetNotificationsQuery query) { return Ok(await _mediator.Send(query)); }
public Task <IEnumerable <EmailFrom> > Handle(GetNotificationsQuery request, CancellationToken cancellationToken) { var result = notificationRepository.GetNotifications(request.Address); return(Task.FromResult(result)); }