Пример #1
0
        protected virtual async Task <List <UserNotificationInfo> > SaveUserNotificationsAsync(Guid[] users, NotificationInfo notificationInfo)
        {
            await NotificationStore.InsertNotificationAsync(notificationInfo);

            await UnitOfWorkManager.Current.SaveChangesAsync();

            var userNotifications = new List <UserNotificationInfo>();

            foreach (var user in users)
            {
                var userNotification = new UserNotificationInfo(user, notificationInfo.Id, notificationInfo.TenantId);
                await NotificationStore.InsertUserNotificationAsync(userNotification);

                userNotifications.Add(userNotification);
            }

            return(userNotifications);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserNotificationWithNotification"/> class.
 /// </summary>
 public UserNotificationWithNotification(UserNotificationInfo userNotification, NotificationInfo notification)
 {
     UserNotification = userNotification;
     Notification     = notification;
 }
 public Task InsertUserNotificationAsync(UserNotificationInfo userNotification)
 {
     return(Task.CompletedTask);
 }