/// <summary> /// Create a new EmailSentException object. /// </summary> /// <param name="id">Initial value of the ID property.</param> public static EmailSentException CreateEmailSentException(global::System.Int32 id) { EmailSentException emailSentException = new EmailSentException(); emailSentException.ID = id; return emailSentException; }
/// <summary> /// Deprecated Method for adding a new object to the EmailSentExceptions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToEmailSentExceptions(EmailSentException emailSentException) { base.AddObject("EmailSentExceptions", emailSentException); }
private static void InsertEmailSentException(int userid, string reason, string receiverEmail = "NoEmailAddress") { using (var context = new SidejobEntities()) { var emailException = new EmailSentException { Reason = reason, UserId = userid, EmailAddress = receiverEmail, DateTime = DateTime.UtcNow.Date, UserRole = "ADM" }; context.AddToEmailSentExceptions(emailException); context.SaveChanges(); } }