Ejemplo n.º 1
0
        public void NewCreate(Guid receiverId, NotificationsTypes type, string text, List <NotificationParam> @params)
        {
            var newNotification = PrepareNotification(receiverId, type, text, @params);

            using (FlyJetsDbContext dbContext = new FlyJetsDbContext(_config))
            {
                //send notification to database
                dbContext.Notifications.Add(newNotification);

                dbContext.SaveChanges();
            }
            //get list of unread notifications
            /* GetNotifications(receiverId); */
        }
Ejemplo n.º 2
0
        private Notification PrepareNotification(Guid receiverId, NotificationsTypes type, string text, List <NotificationParam> @params)
        {
            var notification = new Notification()
            {
                Id         = Guid.NewGuid(),
                Text       = text,
                ReceiverId = receiverId,
                SenderId   = _accountId,
                Read       = false,
                CreatedOn  = DateTime.UtcNow,
                Params     = JsonConvert.SerializeObject(@params)
            };

            return(notification);
        }
Ejemplo n.º 3
0
 public Notification(NotificationsTypes _Type, object _Tag)
 {
     Type = _Type;
     Tag  = _Tag;
 }
 public NotificationMessage(NotificationsTypes type, object tag)
 {
     Type = type;
     Tag  = tag;
 }