/// <summary>
        /// Save Updated Mail
        /// </summary>
        /// <param name="repository">The repository.</param>
        /// <param name="mailMessage">The mail message.</param>
        public static void Save(this IRepository<Mail> repository, Mail mailMessage)
        {
            CodeContracts.VerifyNotNull(repository, "repository");

            repository.DbFunction.Scalar.mail_save(
                MailID: mailMessage.ID,
                SendTries: mailMessage.SendTries,
                SendAttempt: DateTime.UtcNow);

            repository.FireUpdated(mailMessage.ID);
        }
        /// <summary>
        /// Gets the Mail List Typed
        /// </summary>
        /// <param name="repository">
        /// The repository.
        /// </param>
        /// <param name="processID">
        /// The process id.
        /// </param>
        /// <returns>
        ///  Returns the Mail List as Typed List
        /// </returns>
        public static IList<Mail> ListTyped(this IRepository<Mail> repository, int? processID)
        {
            CodeContracts.VerifyNotNull(repository, "repository");

            var mailList = new List<Mail>();

            foreach (DataRow dr in
                repository.DbFunction.GetData.mail_list(ProcessID: processID, UTCTIMESTAMP: DateTime.UtcNow).Rows)
            {
                var mail = new Mail();
                mail.InjectFrom<DataRowInjection>(dr);
                mailList.Add(mail);
            }

            return mailList;
        }