Example #1
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();
     }
 }