Example #1
0
 public void StoreNotification(MessageNotificationModel msg, int userid)
 {
     using (var db = DatabaseFactory.OpenDbConnection())
     {
         var dbNotif = new Model.ORM.Notification <MessageNotificationModel>()
         {
             Id                 = msg.Guid,
             UserId             = userid,
             IsRead             = false,
             NotificationObject = msg,
             Timestamp          = msg.Timestamp,
             Type               = Model.NotificationTypeEnum.message
         };
         db.Insert <Model.ORM.Notification <MessageNotificationModel> >(dbNotif);
     }
 }
Example #2
0
 private void StoreNotification(TopicNotificationModel nt, int userid)
 {
     using (var db = DatabaseFactory.OpenDbConnection())
     {
         var dbNotif = new Model.ORM.Notification <TopicNotificationModel>()
         {
             Id                 = nt.Guid,
             UserId             = userid,
             IsRead             = false,
             NotificationObject = nt,
             Timestamp          = nt.Timestamp,
             Type               = nt.NotificationType
         };
         db.Insert <Model.ORM.Notification <TopicNotificationModel> >(dbNotif);
     }
 }