public void AddNewRecord(Notification_Comm notifMessage) { if (notifMessage == null) { throw new ArgumentNullException("Parameter supplied cannot be null!"); } DBContext.DBModel db = new DBContext.DBModel(); DBContext.Notification_Comunication_History message = new DBContext.Notification_Comunication_History { NotificationId = notifMessage.NotificationID, Message = notifMessage.Message, UpdatedDate = notifMessage.UpdatedDate, SubmitedBy = notifMessage.SubmitedBy }; try { db.Notification_Comunication_History.Add(message); db.SaveChanges(); } catch (Exception ex) { throw ex; } }
public Notification_Comm(DBContext.Notification_Comunication_History db) { if (db == null) { throw new ArgumentNullException("Paramter db supplied is null!"); } Id = (int)db.Id; NotificationID = db.NotificationId; UpdatedDate = db.UpdatedDate; Message = db.Message; SubmitedBy = db.SubmitedBy; }