protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack && Session["NotificationData"] is NotificationData notificationData) { GlobalNotification.ShowNotification(notificationData); } }
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 }); }
private void Awake() { instance = this; }