Пример #1
0
        /// <summary>
        /// Saves or updates a notification
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public static Notification Save(Notification n)
        {
            using (EntityContext ctx = new EntityContext())
            {
                n.ValidateAndRaise();

                if (n.NotificationId == 0)
                {
                    ctx.Notifications.AddObject(n);
                }

                ctx.SaveChanges();

                return n;
            }
        }
Пример #2
0
 partial void DeleteNotification(Notification instance);
Пример #3
0
 partial void UpdateNotification(Notification instance);
Пример #4
0
 partial void InsertNotification(Notification instance);
Пример #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Notifications EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToNotifications(Notification notification)
 {
     base.AddObject("Notifications", notification);
 }
Пример #6
0
 /// <summary>
 /// Create a new Notification object.
 /// </summary>
 /// <param name="notificationId">Initial value of the NotificationId property.</param>
 /// <param name="userId">Initial value of the UserId property.</param>
 /// <param name="createdAt">Initial value of the CreatedAt property.</param>
 /// <param name="createdBy">Initial value of the CreatedBy property.</param>
 public static Notification CreateNotification(global::System.Int32 notificationId, global::System.Int32 userId, global::System.DateTime createdAt, global::System.Int32 createdBy)
 {
     Notification notification = new Notification();
     notification.NotificationId = notificationId;
     notification.UserId = userId;
     notification.CreatedAt = createdAt;
     notification.CreatedBy = createdBy;
     return notification;
 }