protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack && Session["NotificationData"] is NotificationData notificationData)
     {
         GlobalNotification.ShowNotification(notificationData);
     }
 }
Esempio n. 2
0
            public async Task <GlobalNotificationDto> Handle(Command request, CancellationToken cancellationToken)
            {
                // convert to EFCore entity;
                var notification = new GlobalNotification(request.Title, request.Message, request.Url);

                await _context.GlobalNotifications.AddAsync(notification, cancellationToken);

                await _context.SaveChangesAsync(cancellationToken);

                // convert result of the insertion to dto;
                return(new()
                {
                    GlobalNotificationId = notification.GlobalNotificationId,
                    Message = notification.Message,
                    Title = notification.Title,
                    Url = notification.Url
                });
            }
Esempio n. 3
0
 private void Awake()
 {
     instance = this;
 }