Created
May 27, 2018 18:12
-
-
Save explorer14/c093894378d2e7e2d68ea6b1bad3c364 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Functions | |
{ | |
private readonly ICreditCheckFilter creditCheckFilter; | |
private readonly IPipe<EnrichedLoanRequest> pipe; | |
public Functions( | |
ICreditCheckFilter creditCheckFilter, | |
IPipe<EnrichedLoanRequest> pipe) | |
{ | |
this.creditCheckFilter = creditCheckFilter; | |
this.pipe = pipe; | |
} | |
public async Task ProcessQueueMessage( | |
[QueueTrigger("submitted-loan-requests")] string loanRequestPayload, | |
TextWriter log) | |
{ | |
var submittedLoanRequest = JsonConvert | |
.DeserializeObject<LoanRequest>( | |
loanRequestPayload); | |
var enrichedLoanRequest = await creditCheckFilter | |
.PerformCreditCheck(submittedLoanRequest); | |
await pipe.Write(enrichedLoanRequest); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment