UserNotificationInfoExtensions.cs 834 B

1234567891011121314151617181920212223
  1. namespace Abp.Notifications
  2. {
  3. /// <summary>
  4. /// Extension methods for <see cref="UserNotificationInfo"/>.
  5. /// </summary>
  6. public static class UserNotificationInfoExtensions
  7. {
  8. /// <summary>
  9. /// Converts <see cref="UserNotificationInfo"/> to <see cref="UserNotification"/>.
  10. /// </summary>
  11. public static UserNotification ToUserNotification(this UserNotificationInfo userNotificationInfo, TenantNotification tenantNotification)
  12. {
  13. return new UserNotification
  14. {
  15. Id = userNotificationInfo.Id,
  16. Notification = tenantNotification,
  17. UserId = userNotificationInfo.UserId,
  18. State = userNotificationInfo.State,
  19. TenantId = userNotificationInfo.TenantId
  20. };
  21. }
  22. }
  23. }