예제 #1
0
 /// <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;
 }
예제 #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the EmailSentExceptions EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEmailSentExceptions(EmailSentException emailSentException)
 {
     base.AddObject("EmailSentExceptions", emailSentException);
 }
예제 #3
0
 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();
     }
 }