Пример #1
0
        public void SendNotification(NotifModels obj)
        {
            //NotificationHub objNotifHub = new NotificationHub(ILifetimeScope lifetimeScope);

            //Notification objNotif = new Notification();
            //objNotif.SentTo = obj.UserID;


            //objNotifHub.SendNotification(obj.UserID, obj.Message, "success", 1);
        }
Пример #2
0
        public void DisplayedNotification(NotifModels obj)
        {
            //NotificationHub objNotifHub = new NotificationHub(ILifetimeScope lifetimeScope);

            //Notification objNotif = new Notification();
            //objNotif.SentTo = obj.UserID;
            //DomainModel.Notification not = new DomainModel.Notification();

            //Mapper.Map(obj, not);

            //obj.UserID = GetUserId();

            //objNotifHub.RemoveUserNotification(obj.NotificationId, obj.UserID);
        }
        public HttpResponseMessage SendNotification(NotifModels obj)
        {
            NotificationHub objNotifHub = new NotificationHub();
            Notification    objNotif    = new Notification();

            objNotif.SentTo = obj.UserID;

            context.Configuration.ProxyCreationEnabled = false;
            context.Notifications.Add(objNotif);
            context.SaveChanges();

            objNotifHub.SendNotification(objNotif.SentTo);

            var query = (from t in context.Notifications
                         select t).ToList();

            return(Request.CreateResponse(HttpStatusCode.OK, new { query }));
        }