public async Task CheckEmailTemplateIdsAsync(PostRequest request, CancellationToken cancellationToken) { var passwordResetId = request.Model.PasswordResetEmailTemplateId; if (passwordResetId.HasValue && !await fEmailTemplateRepository.ExistsAsync(passwordResetId.Value, cancellationToken)) { throw new BadRequestException($"Email template with ID '{passwordResetId.Value}' dosn't exist."); } var verifyAccountId = request.Model.PasswordResetEmailTemplateId; if (verifyAccountId.HasValue && !await fEmailTemplateRepository.ExistsAsync(verifyAccountId.Value, cancellationToken)) { throw new BadRequestException($"Email template with ID '{verifyAccountId.Value}' dosn't exist."); } }