Esempio n. 1
0
        public async Task <IActionResult> CloseNotification(
            CloseNotificationQuery query,
            CloseNotificationCommand command)
        {
            await _notificationService.HandleAsync(command);

            return(new EmptyResult());
        }
Esempio n. 2
0
        public async Task <CommandExecutionResult> HandleAsync(CloseNotificationCommand command)
        {
            var changeEntry = new ChangeEntry <NotificationEntity>().Key(notification => notification.NotificationId, command.NotificationId)
                              .Property(notification => notification.Closed, DateTime.UtcNow);

            await _repository.UpdateAsync(changeEntry.Entity, changeEntry.Properties);

            return(CommandExecutionResult.Success);
        }