/// <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; } }
partial void DeleteNotification(Notification instance);
partial void UpdateNotification(Notification instance);
partial void InsertNotification(Notification instance);
/// <summary> /// Deprecated Method for adding a new object to the Notifications EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToNotifications(Notification notification) { base.AddObject("Notifications", notification); }
/// <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; }