コード例 #1
0
 /// <summary>
 /// Default Constructor
 /// </summary>
 public NotificationViewModel(IApplication application, IEventAggregator eventAggregator, IQueryDatabase databaseQuery)
 {
     _application     = application;
     _eventAggregator = eventAggregator;
     _databaseQuery   = databaseQuery;
     _eventAggregator.GetEvent <NotificationMessagesUpdateEvent>().Subscribe(UpdateNotifications);
     _eventAggregator.GetEvent <NotificationConfirmationEvent>().Subscribe(async messageFromRenter =>
     {
         //if (messageFromRenter.ConfirmationStatus == MsgStatus.Declined)
         // await _databaseQuery.EraseDaysThatIsRented(messageFromRenter);
         await UpdateNotificationConfirm(messageFromRenter);
         MessageFromLessorModel response = CreateResponseForRenter(messageFromRenter);
         await SendResponseToLessor(response);
     });
 }
コード例 #2
0
 private async Task SendResponseToLessor(MessageFromLessorModel response)
 {
     await _databaseQuery.AddUserMessage(response);
 }