public bool CreateNewEmailVerificationCode(EmailVerificationCode emailverificationcode)
 {
     return(ExecuteProcedureNonQuery("CREATE_NEW_EMAIL_VERIFICATION_CODE",
                                     new List <SqlParameter>()
     {
         new SqlParameter("@UserId", emailverificationcode.UserId),
         new SqlParameter("@DateCreated", emailverificationcode.DateCreated),
         new SqlParameter("@VerificationCode", emailverificationcode.VerificationCode),
         new SqlParameter("@ExpirationDate", emailverificationcode.ExpirationDate),
     },
                                     iCommandTimeout: 60));
 }
        public async Task <IActionResult> GetEmailPriorityCode(EmailConfirmationRequest model)
        {
            var result = await _emailConfirmationService.GetPriorityCode(model.Email, model.PartnerId);

            if (result == null)
            {
                return(BadRequest("Code not found."));
            }

            var response = new EmailVerificationCode(result.Code, result.CreationDateTime, result.ExpirationDate);

            return(Ok(response));
        }
        public EmailVerificationCode ViewEmailVerificationCodeById(Int64 EmailVerificationCodeId)
        {
            EmailVerificationCode response     = null;
            DataTable             lQueryResult = ExecuteProcedureQuery("VIEW_EMAIL_VERIFICATION_CODE_BY_ID",
                                                                       new SqlParameter("@EmailVerificationCodeId", EmailVerificationCodeId),
                                                                       iCommandTimeout: 30);

            if (lQueryResult.Rows.Count > 0)
            {
                response = AutoMap <EmailVerificationCode> .FromDataRow(lQueryResult.Rows[0]);
            }
            return(response);
        }